Passenger/Apache/OSX/Rails: Cannot load such file -- bundler/setup (LoadError)

646 views
Skip to first unread message

safetypin

unread,
May 11, 2016, 10:21:55 AM5/11/16
to Phusion Passenger Discussions
So, I've seen several error reports of this error, but I can't seem to figure out what I'm doing wrong. I used ruby-build to compile Ruby 2.3, and I've used chruby to set the current CLI ruby to be the same as is configured for mod_passenger in apache. I used the passenger-install-apache2-module command to install and correctly configure the apache mod. I'm not sure what information is necessary for troubleshooting this, but as far as I can tell, bundler is installed in the correct place, the same ruby install that passenger is installed in.

> which bundler
/Users/matthew/.gem/ruby/2.3.0/bin/bundler
> which passenger
/Users/matthew/.gem/ruby/2.3.0/bin/passenger
> sudo passenger-status
Version : 5.0.28
Date    : 2016-05-11 09:17:52 -0500
Instance: dsdRnCkb (Apache/2.4.18 (Unix) PHP/5.5.31 Phusion_Passenger/5.0.28)

----------- General information -----------
Max pool size : 6
App groups    : 1
Processes     : 0
Requests in top-level queue : 0

----------- Application groups -----------
/Users/matthew/Sites/sl7 (development):
 App root: /Users/matthew/Sites/sl7
 Requests in queue: 0


cannot load such file -- bundler/setup (LoadError)
  /Users/matthew/.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /Users/matthew/.rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:100:in `preload_app'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /Users/matthew/.gem/ruby/2.3.0/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:29:in `<main>'






safetypin

unread,
May 11, 2016, 10:33:39 AM5/11/16
to Phusion Passenger Discussions
Of course, right after I ask the question, I find a thread that looks like it's describing my exact problem. I think it's an issue with chruby, and the fact that it's installed in my user directory instead of /opt.

If you have any ideas, let me know. I'm currently investigating https://github.com/postmodern/chruby/issues/258

safetypin

unread,
May 11, 2016, 12:55:35 PM5/11/16
to Phusion Passenger Discussions
So, I think I've made some progress. I've got ruby/passenger/bundler installed in /opt/rubies, but it looks like Passenger is unable to access the gems that my app is dependent upon, which bundler has installed in ~/.gems instead of in /opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/ and I'm really not sure what the best way to handle this is. 

Do I need to start using bundle --deployment to install all gems local to the app? It seems like gem environment has the correct path, but it has my user directory listed before the /opt/rubies directory, and I can't seem to figure out how to remove my user directory from GEM_PATH. exporting "GEM_PATH=/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0" in both .zshrc and inside a .gemrc file in my user directory doesn't affect this environment variable.

safetypin

unread,
May 11, 2016, 2:52:43 PM5/11/16
to Phusion Passenger Discussions
It seems to me like I'm now dealing with a separate issue, since Passenger is properly starting up and detecting bundler. I'll start a new thread.
Reply all
Reply to author
Forward
0 new messages