几乎任何rake任务都会发生此错误:
project/Gemfile:4:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0x007f8274ba6ac8> (NoMethodError) ~/.rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler/dsl.rb:7:in `instance_eval' ~/.rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler/dsl.rb:7:in `evaluate' ~/.rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler/definition.rb:18:in `build' ~/.rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler.rb:135:in `definition' ~/.rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler/cli.rb:220:in `install' ~/.rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler/vendor/thor/task.rb:22:in `run' .rvm/gems/ruby-1.9.3-p0-perf/gems/bundler-1.1.4/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
的Gemfile:4
ruby '1.9.3'
解决方法
这条线是在Heroku上运行多个版本的ruby所必需的,但目前需要一个预发布版本的bundler才能在本地运行.
gem install bundler --pre
见http://blog.heroku.com/archives/2012/5/9/multiple_ruby_version_support_on_heroku/