Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to *not* use rvm for a particular Nginx site? #2541

Closed
michaelfranzl opened this issue Jan 13, 2014 · 6 comments
Closed

How to *not* use rvm for a particular Nginx site? #2541

michaelfranzl opened this issue Jan 13, 2014 · 6 comments
Milestone

Comments

@michaelfranzl
Copy link

I want to use system-installed Ruby 1.9.3 (Debian Wheezy) and gems for a particular Nginx site of mine, and ignore rvm completely. When I load the site, I get the error

It looks like Bundler could not find a gem. This is probably because your application is being run under a different environment than it's supposed to.

Then the error page lists various details. It has picked up the correct Ruby binary:

Ruby interpreter command
/usr/bin/ruby

However, the environment variables include all kinds of rvm settings:

rvm_bin_path = /usr/local/rvm/bin
GEM_HOME = /usr/local/rvm/gems/ruby-1.8.7-p374
IRBRC = /usr/local/rvm/rubies/ruby-1.8.7-p374/.irbrc
PATH = /usr/local/rvm/gems/ruby-1.8.7-p374/bin:/usr/local/rvm/gems/ruby-1.8.7-p374@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p374/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin
etc.

The Passenger setting passenger_ruby /usr/bin/ruby1.9.1 does not help.

Any hints?

@mpapis
Copy link
Member

mpapis commented Jan 13, 2014

try this:

rvm mount /usr/bin/ruby -n system
rvm use ext-system
ls $GEM_HOME/wrappers/ruby

(you need RVM 1.25 for that)

@michaelfranzl
Copy link
Author

Posting below the full output because it had errors. The output of ls was /usr/local/rvm/gems/ruby-1.8.7-p374/wrappers/ruby

Mounting 'ext-system' from '/usr' with 'bin/ruby'
ext-system - #making binaries executable.
ext-system - #downloading rubygems-2.2.1
ext-system - #extracting rubygems-2.2.1.
ext-system - #removing old rubygems.
ext-system - #installing rubygems-2.2.1.
Error running 'env GEM_PATH=/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global:/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global GEM_HOME=/usr/local/rvm/gems/ruby-1.8.7-p374  -d /usr/local/rvm/src/rubygems-2.2.1/setup.rb',
showing last 15 lines of /usr/local/rvm/log/1389639992_ext-system/rubygems.install.log
[2014-01-13 20:06:35] 
current path: /usr/local/rvm/src/rubygems-2.2.1
GEM_HOME=/usr/local/rvm/gems/ruby-1.8.7-p374
PATH=/usr/local/rvm/gems/ruby-1.8.7-p374/bin:/usr/local/rvm/gems/ruby-1.8.7-p374@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p374/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin
GEM_PATH=/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global
command(6): env GEM_PATH=/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global:/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global GEM_HOME=/usr/local/rvm/gems/ruby-1.8.7-p374  -d /usr/local/rvm/src/rubygems-2.2.1/setup.rb
env: : No such file or directory
ln: target `' is not a directory: No such file or directory
ext-system - #gemset created @global
ext-system - #importing gemset /usr/local/rvm/gemsets/global.gems......
ext-system - #generating global wrappers.
ext-system - #gemset created 
ext-system - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ext-system - #generating default wrappers.

@mpapis
Copy link
Member

mpapis commented Jan 13, 2014

hmm, it looks wrong, I will try it shortly, if you can wait hour or two I should have a fix for your problems.

@mpapis mpapis closed this as completed in 7500c1e Jan 14, 2014
@mpapis
Copy link
Member

mpapis commented Jan 14, 2014

sorry it took some time but your problem should be fixed with rvm get head

@michaelfranzl
Copy link
Author

Thanks for the fix. I won't be able to test it though, since I decided to run rvm as an unprivileged user (installed rvm as root user before). This way, the Ruby and Gem binaries of my OS are free of the rvm environment variables and run just fine.

@mpapis
Copy link
Member

mpapis commented Jan 14, 2014

it works as far as I tested it so it should be good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants