UPDATE: Heroku now works with the latest Bundler, so this post is (or should be) obsolete.
The Ruby on Rails Tutorial book uses the latest version of Rails, which is the current release candidate of 3.0.0.rc. Unfortunately, at the time of this writing, you can’t deploy applications to Heroku using the Rails release candidate because of a conflict with the latest version of Bundler. Instead of a successful deploy, you get an error like this:
$ git push heroku Counting objects: 4, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 1018 bytes, done. Total 3 (delta 1), reused 0 (delta 0) -----> Heroku receiving push -----> Rails app detected -----> Detected Rails is not set to serve static_assets Installing rails3_serve_static_assets... done -----> Gemfile detected, running Bundler Unresolved dependencies detected; Installing... Your Gemfile.lock was generated by Bundler 0.10. You must delete it if you wish to use Bundler 0.9. FAILED: Have you updated to use a 0.9 Gemfile? http://docs.heroku.com/gems#gem-bundler error: hooks/pre-receive exited with error code 1
Eventually, Heroku support for the Rails release candidate (or perhaps for the final release) will no doubt be ready, but for now you can work around this problem as follows:
$ [sudo] gem uninstall bundler $ [sudo] gem install bundler -v 0.9.26 $ rm -f Gemfile.lock
Then use this as your Gemfile, which reverts back to Rails 3.0.0.beta4:
source 'http://rubygems.org' gem 'rails', '3.0.0.beta4' gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
Then install the gems:
$ bundle install
At this point, the push to Heroku should work. (Of course, that doesn’t mean it will. :-)
$ git add . $ git commit -m "Ready to deploy" $ git push heroku master