I have a local ruby interpreter created a third party which is installed under /usr/lib/projectA/ruby/bin/ruby
Now, I want to copy the whole folder strcuture into another folder with the same structure: /usr/lib/projectB/ruby/bin/ruby
After I copied the files, and call the copied ruby, e.g.
# /usr/lib/projectB/ruby/bin/ruby -v
ruby 1.9.x
Seems to be working, however, when I run
# /usr/lib/projectB/ruby/bin/ruby -e 'puts 1'
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
from <internal:gem_prelude>:1:in `<compiled>'
Seems it can't find the rubygems, so I add the path
# /usr/lib/projectB/ruby/bin/ruby -e 'puts 1' -I '/usr/lib/projectB/ruby/lib/'
/usr/lib/projectB/ruby/lib/ruby/1.9.1/rubygems.rb:31:in `require': cannot load such file -- rbconfig (LoadError)
Now, another files cannot be loaded, so I assume more to come..
So
- What is the correct method to set the new rubygems base path for my new ruby?
- Why even calling
puts 1
will invoke the rubygems?
p.s. I can't use rvm or similar approach as we need to deploy the whole zip package with the ruby to our user.