0

加载我的 Rails 应用程序时收到以下错误消息:

You have already activated builder 3.0.4, but your Gemfile requires builder 3.0.3. Consider using bundle exec.

堆栈跟踪:

0   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb    31  in `block in setup'
1   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb   12  in `block in each'
2   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb   12  in `each'
3   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb   12  in `each'
4   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb    17  in `setup'
5   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler.rb    107 in `setup'
6   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb  326 in `prepare_app_process'
7   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb  176 in `block in initialize_server'
8   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb  563 in `report_app_init_status'
9   /usr/local/ruby/1.9.2/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/lib/phusion_passenger/classic_rails/application_spawner.rb  174 in `initialize_server'

似乎已passenger激活3.0.4,但我的应用程序 Gemfile 仍然具有3.0.3. 我可以添加gem 'builder', '3.0.4'我的 Gemfile,但当新版本出现时它会再次发生。我怎样才能防止这种情况发生?

4

2 回答 2

0

这通常发生在使用 RVM 时,或者只是相对于系统默认值的单独版本的 ruby​​。

配置 RVM 以向乘客提供您用于开发的相同 ruby​​(以及 bundler 安装您的 gems 的位置)。

https://rvm.io/integration/passenger/

于 2012-10-22T18:10:51.710 回答
0

我不确定这种优雅的方式是否我正在使用 binstub。
跑:

bundle install --binstubs
export PATH=./bin:$PATH

您可以在http://blog.davidchelimsky.net/2011/07/18/stop-typing-bundle-exec/阅读更多内容

于 2012-10-23T09:55:45.030 回答