Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)

3,306 views
Skip to first unread message

Camden Narzt

unread,
Jan 6, 2015, 11:43:08 PM1/6/15
to phusion-...@googlegroups.com
I get this error every time I try and start Apache with phusion passenger enabled.

I have ruby 2.2.0 installed via rbenv and rake 10.4.2 is the only version of rake installed.

Anyone got any ideas?

Hongli Lai

unread,
Jan 7, 2015, 4:20:15 AM1/7/15
to phusion-passenger
Most likely, your app isn't being run as the user that it's supposed
to be run as. Have you double checked this? You can force the app to
be run as a specific user by using the PassengerUser directive.
> --
> 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/6dc2bac3-8ef5-45cf-b97e-a95e9aa54ad6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Camden Narzt

unread,
Jan 7, 2015, 10:38:56 AM1/7/15
to phusion-...@googlegroups.com, hon...@phusion.nl
I guess that's possible, though I'm not usre what user to set it to.

The entire error line is:

/Users/camdennarzt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)

and so I guessed that maybe PassengerUser should be camdennarzt, but that didn't change the error at all. Running as root doesn't seem to be permitted as it says it is running as nobody when I try and gives a permissions error. The camdennarzt user has permissions, but has the issue with rake.

Is there anything else I can post to help clarify the issue I'm having?

Hongli Lai

unread,
Jan 7, 2015, 1:40:29 PM1/7/15
to phusion-passenger
On Wed, Jan 7, 2015 at 4:38 PM, Camden Narzt <camden...@gmail.com> wrote:
> I guess that's possible, though I'm not usre what user to set it to.
>
> The entire error line is:
>
> /Users/camdennarzt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.7.11/lib/bundler/spec_set.rb:92:in
> `block in materialize': Could not find rake-10.4.2 in any of the sources
> (Bundler::GemNotFound)
>
> and so I guessed that maybe PassengerUser should be camdennarzt, but that
> didn't change the error at all. Running as root doesn't seem to be permitted
> as it says it is running as nobody when I try and gives a permissions error.
> The camdennarzt user has permissions, but has the issue with rake.
>
> Is there anything else I can post to help clarify the issue I'm having?

Can save the error page as a HTML file and post it here? Can you also
go to your app's directory, run 'bundle show rake' and tell me what
output you see?

Camden Jared Narzt

unread,
Jan 7, 2015, 5:10:32 PM1/7/15
to phusion-...@googlegroups.com
bundle show rake returns:
/Users/camdennarzt/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2

The errors are in my error_log not returned to the browser but here’s the contents of error_log when I start apache.
Terminal Saved Output.txt

Tinco Andringa

unread,
Jan 20, 2015, 8:57:01 AM1/20/15
to phusion-...@googlegroups.com
Hi Camden,

Sorry for the late response, did you manage to solve the problem? Such no found issues are usually to do with file permissions, perhaps you accidentily sudo'ed the installation of one of the gems?

Kind regards,
Tinco

--
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.

For more options, visit https://groups.google.com/d/optout.



> --
> You received this message because you are subscribed to a topic in the Google Groups "Phusion Passenger Discussions" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/phusion-passenger/4DMat3VYQos/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

> For more options, visit https://groups.google.com/d/optout.

--
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.

For more options, visit https://groups.google.com/d/optout.




--
Phusion | Web application deployment, scaling and monitoring solutions

Camden Narzt

unread,
Jan 20, 2015, 10:33:49 AM1/20/15
to phusion-...@googlegroups.com, ti...@phusion.nl
I haven't solved it, no. I have to sudo install gems at the system level if I use system ruby (thanks OS X /sarcasm), but those managed by rbenv (which I use to have a modern version of ruby and to avoid this sudo issue) are definitely not installed with/under sudo/root. I set PassengerDefaultRuby to /Users/camdennarzt/.rbenv/versions/2.2.0/bin/ruby and bundle show rake refers to rake under rbenv so I think passenger is likely to be using the gems from rbenv?

Tinco Andringa

unread,
Jan 23, 2015, 10:35:37 AM1/23/15
to Camden Narzt, phusion-...@googlegroups.com
Hi Camden,

And if you execute `bundle exec rake -T` in your app directory it works? Have you tried running passenger with `passenger start` in your app directory?

Kind regards,
Tinco

Camden Narzt

unread,
Jan 23, 2015, 10:52:44 AM1/23/15
to phusion-...@googlegroups.com, camden...@gmail.com, ti...@phusion.nl
running
bundle exec rake -T
in my app dir gives:
rake db:seed                 # Load the seed data from db/seeds.rb
rake routes
[query]           # Displays a listing of the named routes within a project, optionally only those matched by [query]
rake routes
:app[app]         # Displays a listing of the named routes a given app [app]
rake secret                  
# Generate a secret key
rake sq
:create               # Create the database
rake sq
:drop                 # Drop the database (postgres and mysql only)
rake sq
:migrate              # Perform migration up to latest migration available
rake sq
:migrate:auto         # Perform automigration (reset your db data)
rake sq
:migrate:down         # Perform migration down (erase all data)
rake sq
:migrate:to[version]  # Perform migration up/down to VERSION
rake sq
:migrate:up           # Perform migration up to latest migration available

and running passenger in the same dir with
passenger start
 gives:
*** ERROR ***
Please install daemon_controller first:

 
/Users/camdennarzt/.rbenv/versions/2.2.0/bin/gem install daemon_controller

after installing daemon_controller and rerunning passenger start I get

=============== Phusion Passenger Standalone web server started ===============
PID file
: /Users/camdennarzt/Developer/Ruby/arewesmallyet/tmp/pids/passenger.3000.pid
Log file: /Users/camdennarzt/Developer/Ruby/arewesmallyet/log/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/documentation/Users%20guide%20Standalone.html#troubleshooting
===============================================================================
App 44047 stdout:
[ 2015-01-23 08:46:43.9063 44032/0x10adeb000 Pool2/SmartSpawner.h:298 ]: Preloader for /Users/camdennarzt/Developer/Ruby/arewesmallyet started on PID 44047, listening on unix:/tmp/passenger.1.0.44029/generation-0/backends/preloader.r79k03
App 44061 stdout:
  DEBUG
- 23/Jan/2015 08:46:43     HEAD (0.0018s) / - 302 Found

Tinco Andringa

unread,
Jan 26, 2015, 6:31:11 AM1/26/15
to Camden Narzt, phusion-...@googlegroups.com
Hi Camden,

That looks like it probably is working using standalone (you can test by going to localhost:3000), so that definitely means something is going wrong in your Apache configuration.

I just looked over the thread again and see you've posted a terminal output. Sorry I missed that, it says there that your app is running as 'nobody'. That's the issue, if you configure Passenger to be ran as 'camdenarzt' everything will run fine.

Kind regards,
Tinco

Cody Robbins

unread,
Feb 28, 2015, 4:05:06 PM2/28/15
to phusion-...@googlegroups.com, camden...@gmail.com, ti...@phusion.nl

I'm seeing this exact same problem—I'm using Ruby 2.2.0 installed via Rbenv and I get the same error about rake 10.4.2 not being found.


My Rails app seems to be running fine despite this error, but the fact that the stack trace starts from the system Ruby installation, which is version 2.1.0, makes me concerned. Is my app running under the system Ruby? PassengerDefaultRuby is set to /home/rails/.rbenv/versions/2.2.0/bin/ruby, which is where Rbenv installed Ruby.


The PassengerUser directive is properly set and the Passenger worker processes are all running as that user in the process table. I'm using version 1:4.0.59-1~trusty1 on Ubuntu installed from Phusion's APT repository.


The full error is:


App 9568 stderr: /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/spec_set.rb:92:in `block in materialize'

App 9568 stderr: : 

App 9568 stderr: Could not find rake-10.4.2 in any of the sources

App 9568 stderr:  (

App 9568 stderr: Bundler::GemNotFound

App 9568 stderr: )

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/spec_set.rb:85:in `map!'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/spec_set.rb:85:in `materialize'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/definition.rb:132:in `specs'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/definition.rb:177:in `specs_for'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/definition.rb:166:in `requested_specs'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/environment.rb:18:in `requested_specs'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/runtime.rb:13:in `setup'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler.rb:122:in `setup'

App 9568 stderr:        from /home/rails/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.8.2/lib/bundler/setup.rb:18:in `<top (required)>'

App 9568 stderr:        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

App 9568 stderr:        from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

Camden Narzt

unread,
Feb 28, 2015, 4:16:26 PM2/28/15
to phusion-...@googlegroups.com, camden...@gmail.com, ti...@phusion.nl
So this was a heck of a thing to solve for me so hopefully I can save you a lot of aggravation.

Set your PassengerDefaultRuby to /home/rails/.rbenv/shims/ruby in your apache config so that passenger gets the rbenv environment loaded when it starts ruby, otherwise it won't know where to find gems like rake. (It also fixes an issue with compiling native extensions that you would probably run into eventually otherwise).

Cody Robbins

unread,
Feb 28, 2015, 4:29:51 PM2/28/15
to phusion-...@googlegroups.com, camden...@gmail.com, ti...@phusion.nl
Thanks for the quick reply! That does indeed fix it for me.

The crazy part is that I literally typed the path to the shim into my config file at one point but then reverted it back without trying it out because I convinced myself the shims were just for command line use.

Eshaan Bansal

unread,
Jan 7, 2016, 5:30:10 PM1/7/16
to Phusion Passenger Discussions, camden...@gmail.com, ti...@phusion.nl

Guys! Please help me with this problem. And that too command by command, I am a beginner. Thanks.

Daniel Knoppel

unread,
Jan 7, 2016, 6:39:02 PM1/7/16
to Phusion Passenger Discussions
Sorry, this is a forum about Phusion Passenger, not about MetaSploit ;)

- Daniel
Reply all
Reply to author
Forward
0 new messages