Rails 3.1 Deployment to Heroku Error

ardavis picture ardavis · Jun 3, 2011 · Viewed 9k times · Source

I'm trying to deploy my app to Heroku, I've done this before on my Windows machine, and now I am currently using a mac.

I'm trying to use Postgresql for the first time.

I have the following in my Gemfile:

gem 'pg'

EDIT:

AndrewDavis-OSX:lunchbox ardavis$ rvm list

rvm rubies

=> ruby-1.9.2-p180 [ x86_64 ]

AndrewDavis-OSX:lunchbox ardavis$ heroku rake db:migrate
rake aborted!
/app/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end
App::Application.config.session_store :cookie_store, key: '_app_session'
                                                        ^

(See full trace by running task with --trace)
(in /app)

As you can see, I am running ruby 1.9.2. And there is the error for my heroku migration.

EDIT 2:

Just created a brand new rails app using Rails 3.1.rc1. I set the gemfile to include

group :production do gem 'therubyracer-heroku', '0.8.1.pre3' gem 'pg' end

I did a quick git init, commited, then 'heroku create' and 'git push heroku master'. Those all work just fine. However the problem is when I try 'heroku rake db:migrate'. I get the same error that you see above.

TEMP FIX EDIT:

So... if I change my config/initializers/session_store.rb from

App::Application.config.session_store :cookie_store, key: '_app_session'

to

App::Application.config.session_store :cookie_store, :key => '_app_session'

and change my config/initializers/wrap_parameters.rb from

ActionController::Base.wrap_parameters format: [:json]

to

ActionController::Base.wrap_parameters :format => [:json]

Then I'm able to do 'heroku rake db:migrate' just fine. Anyone care to explain why this works locally the original way, without any modification of the colons/hashes? The original way is the generated default from doing 'rails new myApp'

Answer

ardavis picture ardavis · Jun 4, 2011

The Heroku stack needs to be migrated, you can run this command to do so:

heroku stack:migrate bamboo-mri-1.9.2 

I was running 1.9.2 locally, which is why it was working locally. But on Heroku, it was running 1.8.7.