Could not find rake-10.0.4 in any of the sources - passenger.conf issue?
Asked Answered
M

2

3

So, I'm going a little mad trying to work out why I'm getting this error.

Probably serves me right for taking the Bitnami shortcut for installing Spree. I get the following error after trying to change the gemfile from gem 'spree', '2.0.1' to gem 'spree', '2.0.2' (or getting the latest stable version from github)

    [agents/HelperAgent/RequestHandler.h:1888 ]: [Client 21] Cannot checkout session. An error occured while starting up the preloader.
    Error page:
    Could not find rake-10.0.4 in any of the sources (Bundler::GemNotFound)
    <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize'
    ...
    <bitnami_install_dir>/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    ...
    <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
    ...
    <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/helper-scripts/rack-preloader.rb:5:in `<main>'

I've deleted gemfile.lock, re-run bundle install and I can see that I have the correct version of rake installed (10.0.4). From researching on the web, I'm guessing that it's probably something to do with Passenger point to a different version of ruby to the one I'm trying to run (I'm using 1.9.3 and the stack trace is moaning about 1.9.1)

Unfortunately, I'm struggling to fix this.

I couldn't get passenger-config --ruby-command to run, but I did find my passenger.conf:

    <bitnami_install_dir>\apache2\conf\bitnami\passenger.conf

I've been trying to change the following line:

    PassengerRuby <bitnami_install_dir>/ruby/bin/ruby

but can't seem to find the right path (assuming I'm actually heading up the right path...).

I looked up my rvm env --path =>

    $ rvm env --path
    /usr/local/rvm/environments/ruby-1.9.3-p194

Tried /usr/local/rvm/environments/ruby-1.9.3-p194 and /usr/local/rvm/environments/ruby-1.9.3-p194/ruby but still no joy.

I've been staring at the screen too long, and it's starting to get late - would appreciate a nudge in the right direction if you can spot what I'm doing wrong.

Miele answered 12/6, 2013 at 15:22 Comment(6)
Does it work if you change back to '2.0.1'? Why didn't you make bundle update?Sw
The references to 1.9.1 in the stack trace don't mean anything; Ruby versions 1.9.2 and 1.9.3 still store gems under the gems/1.9.1 directory.Insectivore
@KentTucky - yes, switching back to gem 'spree', '2.0.1' worked. I did also try bundle update- my bad for not mentioning it. My problem is not that it doesn't use the correct version of the spree gems, but passenger is using the wrong version of Ruby.Miele
@Wally thanks for clarifying that! (apologies - my fat fingers accidentally undid my upvote of your comment and now I can't reapply it)Miele
I don't know about bitnami, but did you add the passenger installation output to your webservers config file? Are you using Apache?Sw
I didn't have to install passenger or setup the apache config - that's the joy of bitnami it generates the full stack (but then it comes back to bite you when you're not sure how to change it as you didn't set it up yourself). I have Include conf/bitnami/passenger.conf in my httpd.confMiele
M
1

OK, so with a fresh head after a good night's sleep and a bit more digging and I think I've got to the bottom of it.

I came across a post with a similar question to mine that put me on the trail of rvm wrappers. After a bit more searching I found the documentation that I should have referenced right from the start:

So in my case, the solution is to update the PassengerRuby definition in <bitnami_install_dir>\apache2\conf\bitnami\passenger.comf to point to:

    PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby

Now everything runs smoothly with the new gem versions (or git checkouts).

Miele answered 13/6, 2013 at 13:35 Comment(0)
M
1

Footnote: I also discovered my mistake when trying to execute passenger-config:

$ cd <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/bin
$ rvm use 1.9.3
$ passenger-config --ruby-command
-bash: passenger-config: command not found

I should have used the fully qualified path to passenger-config (nicely illustrating the danger of blinding oneself by staring at it for too long):

 $ rvm use 1.9.3
 $ <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/bin/passenger-config --ruby-command
 passenger-config was invoked through the following Ruby interpreter:
   Command: /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby
   Version: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]
   To use in Apache: PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby
   To use in Nginx : passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby
   To use with Standalone: /usr/local/rvm/wrappers/ruby-1.9.3-p194/ruby <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/bin/passenger start

 The following Ruby interpreter was found first in $PATH:
   Command: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
   Version: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]
   To use in Apache: PassengerRuby /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
   To use in Nginx : passenger_ruby /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
   To use with Standalone: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby <bitnami_install_dir>/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.2/bin/passenger start
Miele answered 13/6, 2013 at 13:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.