Question

I have ruby project and I installed all gems using 'bundle install'. Gems was installed in ./vendor/bundle. But I use ruby installed by rvm in another directory and when I try to do something (some command) It is looking for gems in rvm directory. How to install all gems in rvm directory?

Edit: I installed all gems but when I tried to user simple ruby -T I get:

/home/arkency/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'rake' (>= 0) among 1 total gem(s) (Gem::LoadError)
from /home/arkency/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'
from /home/arkency/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /home/arkency/.rvm/gems/ruby-1.9.3-p545/bin/rake:22:in `<main>'
from /home/arkency/.rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15:in `eval'
from /home/arkency/.rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15:in `<main>'

My gem list contain only:

gem list

*** LOCAL GEMS ***

bundler (1.6.2)
Était-ce utile?

La solution

By default, bundler installs gems to the system gem store. However, it has an optional configuration setting to install gems into another directory (in your case vendor/bundle). These gems are then only available in the specific bundler context.

You can force bundler to install the gems into the system gem store by running

bundle install --system

thus making them available to your global ruby installation.

This is necessary as bundler remembers certain options (e.g. the path where to install gems to) in the .bundle directory besides your Gemfile.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top