问题
I have installed my dependencies using
bundle package
Then transferred them to the offline server and running:
> bundle install --local
Using mime-types (1.19)
Using rest-client (1.6.7)
Using trollop (1.16.2)
Using bundler (1.1.4)
Your bundle is complete! It was installed into ./vendor/bundle
However, it is not possible to run the application:
ruby someprogram.rb
/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- trollop (LoadError)
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from someprogram.rb:2:in `<main>'
What do I need to specify to Ruby to be able to run locally installed gems?
回答1:
You're missing bundle exec in front of your ruby someprogram.rb
command.
来源:https://stackoverflow.com/questions/11293339/how-to-execute-ruby-program-with-locally-installed-gems