David Radcliffe

Rails 3.1 (rc4) on Heroku

I’ve been upgrading one of my apps to Rails 3.1 (rc4) this week and I attempted to deploy it to Heroku today. At first it was a miserable failure but I’ve been able to work through the bugs and its running well now. I’ll highlight the things I found so that maybe it won’t take you as long as it took me.

New Relic

New Relic does not work with rails 3.1 rc4. If you’re using it (you should be), just comment out the gem for now. I’m sure they will get it working by full release time.

“We do not work with the Rails 3.1 release candidate (RC4).”

source: https://support.newrelic.com/kb/ruby/new-relic-for-ruby


For some reason I need to specify the pg gem myself. Just add the following to your Gemfile:

gem 'pg', :group => :production

JavaScript interpreter

Rails 3.1 uses sprockets (which is awesome) which uses execjs which requires a javascript interpreter to run properly. There are several options but it seems that the only current option that works on Heroku is “The Ruby Racer” heroku build. You can add the following to your Gemfile:

gem 'therubyracer-heroku', '0.8.1.pre3', :group => :production

source: http://quickleft.com/blog/rails-31-sprockets-and-heroku