Заметки Ruby программиста Всякие полезные наработки


How to run Rails 3 rc on heroku

Heroku is awesome! You can easily run Rails 3 Beta on Heroku without any hacks. But if you want run Rails 3 RC where will be a problem: Rails 3.0.0.rc depends on Bundler 1.0.0.rc but Heroku now supports only Bundler 0.9.26. So you can't run app based on Rails 3.0.0.rc gem easily on Heroku now.

But i have found simple solution of this problem - downgrade bundler dependency on Rails fork and use it instead of Rails 3 gem. Like this:

gem 'rails', :git => 'git://github.com/chipiga/rails.git', :branch => 'downgrade_bundler'

And this little hack is just works fine for me!

But here is one more thing you should know about if you want use latest bundler locally: you should do not include Gemfile.lock into your git repo, because server side bundler will detect what you have used higher version of bundler and will not run. This case you should be careful with gem version dependencies in your Gemfile because you may get unexpected gem update during next deploy session because Bundler each time will re-create environment. Alternatively you can use Bundler 0.9.26 locally too.

By the way i use this little hack to detect heroku environment:

ENV['RUBYOPT'] && ENV['RUBYOPT'].include?('nobuffer') ? true : false

Does anybody know better solution?

Just now receive notification from heroku - they are planning upgrade bundler to 1.0.0.rc2 version this week

Комментарии (0) Пинги (0)

Пока нет комментариев.

Leave a comment

Нет обратных ссылок на эту запись.