Pushing a Rails 4.0.0.rc2 app to Heroku 6/15/13

By Chris Johnson

I’m working on a new side project in Rails 4.0.0.rc2 that I wanted to host on Heroku. The current Heroku documentation for Rails 3 got me most of the way to a working app, but I ran into two problems:

  • Rails 4 requires Ruby 1.9.3 or newer. My app failed to work on Heroku's Cedar stack until I added this line to my Gemfile:

    ruby '1.9.3' # If you're running a newer version of Ruby, specify it here

    After changing your Gemfile be sure to run bundle install again.

  • My CSS and Javascript assets would not load even though Heroku wasn’t throwing any errors. I fixed this problem by changing config.assets.compile to true in my production.rb file:
    config.assets.compile = true

Update: You can read Heroku’s unreleased Rails 4 documentation here. Thanks to Trevoke on Reddit for the tip.