Phusion Passenger and Bundler Groups

19 views
Skip to first unread message

Moritz Pipahl

unread,
Sep 28, 2015, 5:39:16 AM9/28/15
to Phusion Passenger Discussions
Hi there,

Im relatively new to using Ruby and Im currently running two sites on Passenger / nginx (so please apologize if this is a newbie question).

I tried to deploy the second site yesterday and had quite some problems with the fact that Passenger seems to require all gems in my Gemfile, even those that belong to groups test or development (net-ssh is pulled in by capistrano, which is in group development):

Could not find net-ssh-2.9.1 in any of the sources (Bundler::GemNotFound)

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/spec_set.rb:92:in `block in materialize'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `map!'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `materialize'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/definition.rb:140:in `specs'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/definition.rb:185:in `specs_for'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/definition.rb:174:in `requested_specs'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/environment.rb:18:in `requested_specs'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:13:in `setup'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup'

/usr/local/lib64/ruby/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/setup.rb:18:in `<top (required)>'

/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

/usr/lib64/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

/usr/local/lib64/ruby/gems/1.9.1/gems/passenger-5.0.20/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:411:in `activate_gem'


So I wanted to ask if there is some way to prevent Passenger from requiring gems that are in groups (test/development) in the Gemfile.


Best regards,

Moritz Pipahl


Hongli Lai

unread,
Sep 30, 2015, 12:19:44 PM9/30/15
to phusion-passenger
This is not a Passenger issue, but rather a Bundler issue. Passenger
*sets up* Bundler (`Bundler.setup`, has the same effect as `bundle
exec`), but does not *require* files inside the Gemfile
(`Bundler.require`). When setting up Bundler, Bundler insists that all
gems inside the Gemfile must exist. Only during calls to
`Bundler.require` does Bundler not require gems in excluded groups.
However, Rails is responsible for calling `Bundler.require`, not
Passenger.
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/90349cff-b8a3-4371-aece-47aca8c794bd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)
Reply all
Reply to author
Forward
0 new messages