Get Rails 3.1beta1 on Heroku

Get Rails 3.1beta1 on Heroku

It’s pretty simple, you only have a couple of things to change.

First, in config / environments / production.rb change

config.serve_static_assets = false 

to

config.serve_static_assets = true

Second, in your Gemfile, add

gem 'therubyracer-heroku', '0.8.1.pre3'
gem 'pg'

Now you can do bundle install, commit to git, push to heroku and you should be rocking Rails 3.1beta1 :D

If you’re having database issues, I suggest taking a look at this Gemfile by @sferik

UPDATE: I just started a new project, and it seems like there’s something else to change in config / initializers / session_storerb:

AppName::Application.config.session_store :cookie_store, key: '_appname_session'

to

AppName::Application.config.session_store :cookie_store, :key => '_appname_session'

UPDATE 2: Thanks to Jeff Gardner, I now understand why the last update is needed: Heroku’s default stack is still using 1.8.x (until June 1st I believe) and Rails 3.1 beta1 is making use of ruby 1.9.2’s key: value hash syntax. To make it work without changing the file you can simply run this in your console:

heroku create --stack bamboo-mri-1.9.2

if you’re creating a new app, and

heroku stack:migrate bamboo-mri-1.9.2

if you’re migrating an existing one!

Have fun :)

Show Comments