0

I get the following error message when loading my Rails application:

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

Stack trace:

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'

It seems as though passenger activated 3.0.4 but my application Gemfile still has 3.0.3. I can add gem 'builder', '3.0.4' in my Gemfile but it will happen again when a new version comes out. How can I prevent this from happening?

Artem Kalinchuk
  • 6,502
  • 7
  • 43
  • 57
  • "I get the following error message" ... when doing *what*? – Edd Morgan Oct 22 '12 at 14:13
  • "Application failed to start" message from passenger. This message is displayed when an application fails to start. – Artem Kalinchuk Oct 22 '12 at 14:16
  • If you don't update passenger, and don't change your gemfile, you shouldn't have a conflict. Specifying the exact patch value of the gem will force it to that version always. – agmcleod Oct 22 '12 at 17:28
  • @agmcleod Is that good practice? – Artem Kalinchuk Oct 23 '12 at 14:15
  • Well you don't want to change production software willy nilly. If there are crucial fixes, you need to do the setup in a staging server first, make sure it works and update things manually on the production server. My point is it won't update until you tell it to. – agmcleod Oct 23 '12 at 14:19

2 Answers2

0

This usually happens when using RVM, or just a separate version of ruby with respect to the system's default.

Configure RVM to provide passenger the same ruby you use for development (and where bundler installs your gems).

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

rewritten
  • 16,280
  • 2
  • 47
  • 50
  • `First of all there's passenger-install-apache2-module and passenger-install-nginx-module. At the end of the installation it outputs a PassengerRuby configuration snippet for the web server. Its value is set to the RVM Ruby wrapper script that corresponds with the RVM Ruby and RVM gemset that was used to run the installer. This should be all you need for configuration of Passenger 3!` I have Passenger 3, do I still need to configure anything else? I believe it's using the same Ruby version. – Artem Kalinchuk Oct 23 '12 at 14:07
0

I am not sure if this elegant way or not I am using binstub.
Run:

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

You may read more at http://blog.davidchelimsky.net/2011/07/18/stop-typing-bundle-exec/

Max Markov
  • 924
  • 12
  • 23