tasks:
-
set up rvm gemset environment
rvm --rvmrc --create 2.0.0@global
-
run rails new
rails new mdot
-
change gemfile to specifically ask for ruby 2.0
| 1. make a new secret token at the command line | |
| rake secret | |
| 2. set the var in staging and production, run for each | |
| heroku config:set SECRET_TOKEN=9813745901y30fhi2304ify1034yf1083y5r013yfr0813gf9 --remote <stagingORproduction> | |
| 3. remove the secret_token.rb code in favor of the GETTER for ENV['SECRET_TOKEN"] | |
| YourAPP::Application.config.secret_key_base = if Rails.env.development? or Rails.env.test? | |
| "3eb6db5a9026c547c72708438d496d942e976b252138db7e4e0ee5edd7539457d3ed0fa02ee5e7179420ce5290462018591adaf5f42adcf855da04877827def2" | |
| else |
| <%= link_to "NEW TAB", merchants_path, :target => '_blank' %> | |
| <%= link_to "POPUP!", | |
| merchants_path, | |
| :onclick=>"window.open(this.href,'popup_form', 'height=371, width=460, top=200px, left=100px, directories=no, location=no, menubar=no, status=no, titlebar=no, toolbar=no, status=no');return false;" %> |
| 1. first run the pg version of dbconsole in heroku by using this command : | |
| heroku pg:psql --remote heroku (<staging>) | |
| 2. list the tables in psql by using this command | |
| \dt | |
| 3. get the proper name of the table and list the schema by using this command |
Let’s assume we have an existing project called ‘foo’ and we want to create a fork called ‘bar’.
First, create a new project on GitHub called ‘bar’.
Next, clone foo using the name ‘bar’:
$ git clone git@github.com:YOURNAME/foo.git bar
$ cd bar
Next, edit your Git config file and replace the origin URL with your new URL:
| fix with build edit scheme > diagnostics > enable NS zombie objects | |
| will put a zombie (blank) object where the missing objet is and give you a error msg as to where the problem is |
| resque-web --- launch the web inteface | |
| to have Resque available on the website : | |
| mount the Resque::Server to the routes | |
| add the server requirement to the resque gem | |
| add HTTP authentication to the Resque::Server | |
| 1. make staging.rb in config/environments - copy production.rb for starters | |
| 2. in database.yml , application.yml , cloudinary.yml ... any .yml file , copy the production block and name it staging | |
| 2b. if you are using Resque - make a staging env in initializers/resque.rb | |
| 2c. add staging constants for any system-wide URLs | |
| 3. heroku create --remote staging <staging_app_name> --addons [any add ons here]. | |
| create the staging area of the config file | |
| <staging_app_name> is the part of the url before '.herokuapp.com' -- muy importante , dont forget | |
| 4. heroku config:add RACK_ENV=staging RAILS_ENV=staging --remote staging | |
| set up the rails environment vars | |
| 5. git push staging master |
| git config heroku.remote staging | |
| sets the normal heroku commands to the heroku environment | |
| heroku apps:create <name> --remote staging | |
| heroku config:set RACK_ENV=staging RAILS_ENV=staging --remote staging |
| You can either put | |
| gs = Gift.all; | |
| or | |
| gs = Gift.all; nil | |
| the second one is a little better as it terminates the method , the first one starts a block like behavior in the console |