I have shifted to ree using rvm by:
rvm use ree@mygemset
and installed kaminari gem through Gemfile and bundle install.
But Phusion passenger seems to still look for the gem in system default directory. It says:
Error message:
Could not find kaminari-0.10.4 in any of the sources (Bundler::GemNotFound)
What do I missing? Rails need any specific configuration to recognize the current ruby version and gemset I am using??
You need to instruct Passenger to load RVM and then setup the environment for your gemset. The easiest way to go about this involves three steps:
Create a
.rvmrc
file: In the root of your rails project, create a file called.rvmrc
that contains the RVM command you would use to load up your gemset. For example:Trust the
.rvmrc
file: Once you've deployed your new.rvmrc
file to your server, change directories into your rails project. RVM should ask you if you want to trust your.rvmrc
file; simply follow the instructions and typeyes
when asked. If the prompt does not appear, use the following command to trust your.rvmrc
:Note: If you wish to automatically trust all
.rvmrc
s, it is a simple matter of adding:to your personal or system wide rvmrc (
~/.rvmrc
and/etc/rvmrc
, respectively).Instruct passenger to set up the RVM environment: Instruct passenger to load up RVM and use the gemset in your
.rvmrc
file by creating a new file in your Railsconfig
directory calledsetup_load_paths.rb
(soconfig/setup_load_paths.rb
in all). The file should contain the contents of https://gist.github.com/870310:Now when you restart your app (
touch tmp/restart.txt
) you should be good to go.You should note that Passenger can only run one version of Ruby at a time; if Passenger was set up under something other than ree, you will probably have to reinstall Passenger and/or redo the wrapper script it generates.
Just an additional note to step3 of the Marked (Broandon's) answer, because I didn't get my Passenger3 up and run by using those codes.
The error message is as below:
Referring to the message "Unable to locate the RVM path", I checked the RVM Documentation https://rvm.io/integration/passenger/
Edit config/setup_load_paths.rb to this:
Problem solved!
Remove the
config/setup_load_paths.rb
file for Passenger 4. It is not needed.I followed the suggested answer and it moved me forward but then I got an error message:
Passenger now have a gem. My mistake was not installing it in the ruby version and gemset I was using. Once I did that - everything worked sweet.