简体   繁体   English

Bundler:将本地gem与系统gem一起安装

[英]Bundler: install local gem with system gems

I am using rvm, ruby 2.0.0 and bundler. 我正在使用rvm,ruby 2.0.0和bundler。

My Gemfile looks like this: 我的Gemfile看起来像这样:

source 'https://rubygems.org'
gem 'logger'
gem 'mygem', :path => '.'

bundle installs both of them gems. bundle会同时安装两个宝石。 bundle show shows logger is installed in ~/.rvm/gems/ruby-2.0.0-p247/gems , but mygem is installed in the path where the gem is located. bundle show显示logger已安装在~/.rvm/gems/ruby-2.0.0-p247/gems ,但mygem安装在gem所在的路径中。

Is there any way to get bundle to install the local gem into rvm's gems directory? 有什么办法可以bundle将本地gem安装到rvm的gems目录中?

No, Bundler treats path gems differently and does not install them to your GEM_PATH . 不,Bundler对路径宝石的处理方式不同,并且不会将其安装到您的GEM_PATH This is so that you don't need to reinstall as you make changes. 这样一来,您进行更改时就无需重新安装。

It is not normal or necessary for a gem to point to itself or its runtime dependencies in its Gemfile . gem在Gemfile指向自身或其运行时依赖项是不正常或不必要的。 You might want to add gemspec to do this automatically. 您可能需要添加gemspec来自动执行此操作。 See http://bundler.io/v1.3/rubygems.html 参见http://bundler.io/v1.3/rubygems.html

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

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