简体   繁体   English

捆绑商看不到已安装的gem(使用RVM)

[英]Bundler not seeing installed gem (with RVM)

The gem is in the bundle, but bundler can't see it. 宝石在捆绑包中,但捆绑器看不到它。

~/rails_projects/xxx $ rake db:migrate
  Could not find rdoc-4.2.0 in any of the sources
  Run `bundle install` to install missing gems.

~/rails_projects/xxx $ bundle show rdoc
  /home/funkdified/.rvm/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rdoc-4.2.0

Addendum 附录

~/rails_projects/xxx $ bundle exec rake db:migrate
  Could not find rdoc-4.2.0 in any of the sources
  Run `bundle install` to install missing gems.

bundle install
  Bundle complete! 26 Gemfile dependencies, 93 gems now installed.
  Use `bundle show [gemname]` to see where a bundled gem is installed.

bundle show rdoc
  /home/funkdified/.rvm/rubies/ruby-2.2.2/lib/ruby/gems/2.2.0/gems/rdoc-4.2.0

rvm gemdir
  /home/funkdified/.rvm/gems/ruby-2.2.2@xxx

How can I make bundler see the bundle's gem? 我怎样才能使捆扎机看到捆扎的宝石?

You need to execute in the context of bundler 您需要在捆绑程序上下文中执行

bundle exec rake db:migrate

This command executes the command, making all gems specified in the Gemfile(5) available to require in Ruby programs. 该命令执行命令,使Gemfile(5)中指定的所有gem都可以在Ruby程序中使用。

TRY 尝试

gem install bundler

There might be sometimes problem with the bundler gem 捆绑包有时可能会出现问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM