When I need to run a script from my linux user "user1", I do the following commands (right after login with "user1"):
rvm use 1.9.3
cd /var/proj
ruby main.rb
When developing this script, I have created a bundle with bundle install
, reading my Gemfile (containing httparty and other stuff).
This is working fine (no reason it would not work :) )
When I log with another user "user2", I'd like to execute the script but cannot have it working:
cd /var/proj
/home/user1/.rvm/rubies/ruby-1.9.3-p327/bin/ruby main.rb
The error I get:
/home/user1/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- httparty (LoadError)
from /home/user1/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from main.rb:3:in `<main>'
It seems it cannot see the bundle created by the other user. Any idea of what needs to be changed ?
I'd like to run this script within supervisor but this is the same thing.