开发者

Install Gems Into a Project Bundle Using Another Bundle or Installed Gem Folder as The Source

开发者 https://www.devze.com 2023-04-11 13:09 出处:网络
I\'ve got dozens of Ruby projects using Bundler, each with their own gem bundle in ./vendor. I\'d like to be able to do something like this at the top of my Gemfile:

I've got dozens of Ruby projects using Bundler, each with their own gem bundle in ./vendor. I'd like to be able to do something like this at the top of my Gemfile:

source 'file:///Users/midwire/.rvm/gems/ruby-1.8.7-p352'

But this doesn't seem to work unless I'm not doing开发者_开发问答 it right. Is there a way to accomplish this, or possibly a way to just copy gems from another project's bundle or from my global installed gem repository in:

/Users/midwire/.rvm/gems/ruby-1.8.7-p352

It just seems a bit inefficient to be hitting the wire every time I install the pry gem when I've already got it on my hard drive in 78 locations.

Thanks in advance for any help.


The source directive refers to a RubyGems server.

$ gem server -d /Users/midwire/.rvm/gems/ruby-1.8.7-p352/ --daemon

Using a localhost source in Gemfile:

source 'http://127.0.0.1:8808/' # port is usually required

I believe what you want is the ability to specify a local filepath to the gem:

gem 'my_gem', '1.0.0', :path => '/Users/midwire/.rvm/gems/ruby-1.8.7-p352/...'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号