A little “remember me later” for conditionally deploying a Rails 3 app running on Ruby 1.9 on Heroku.
$ruby_version = `ruby --version`.split[1].to_f
source :rubygems
source 'http://gems.github.com'
gem 'rails', '~> 3.0.0'
gem 'bson_ext'
gem 'decent_exposure'
gem 'haml'
gem 'mongoid'
group :development, :test do
if $ruby_version < 1.9
gem 'ruby-debug'
else
gem 'ruby-debug-base19', "0.11.24"
gem 'ruby-debug19', "0.11.6"
end
gem 'rspec-rails'
gem 'rails3-generators' #for HAML
end
Update: Mongoid changed gem versioning for lexicographical sorting (a "dot" between "beta" and the number
Update: Latest mongoid (beta.16 and something after beta.9) requires Rails 3.0.0.rc which doesn't support Ruby 1.9.1 which isn't yet on Heroku
Update: Heroku user doesn't have "repo" in it anymore and USER env var isn't available - find new mechanism if bundler config WITHOUT option doesn't work
Update: All is good now! No need to put any Heroku detection in the Gemfile. Just issue the following command heroku config:add BUNDLE_WITHOUT="development:test"
Also:
- Only the
--colo(u)rand--formatoptions work in the.rspecfile use_transactional_fixtures=falseinspec_helper.rb(talk to Chelimsky about transactional fixtures in non-ActiveRecord environments)- In application.rb:
require 'mongoid/railtie'require 'decent_exposure/railtie'g.orm :mongoidg.template-engine :hamlg.text_framework :rspec, :fixture => false, :views => false