开发者

Bundler cant find gem installed on system

I'm having a problem with one of my gems and I need to test my code with a rails app, I usually do this by adding a symlink in vendor/plugins but I think what I want to do needs it to be required as a gem not a plugin.

I've used bundler in the gem so I can build it with rake build, or install it using rake install, I've done a rake install and I get a lovely green text message saying that my gem has been installed. So I swapped over to my Rails app and added gem 'gemname', '1.0.0pre' to my Gemfile (matching the version I just installed) and ran a bundle install and it just hangs and then throws up and error saying it cant find the gem in any of my sources.

I've already run through making sure that I was using the right rvm ruby when installing the gem etc... and I'm at a loss as to why this wont开发者_如何学Python work. Bundler normally has no problems with gems I already have installed.


Bundler only knows about gems from sources specified in the Gemfile.

Put your gem in vendor/gems and then specify the location in your Gemfile like this:

gem "yourgem", :path => "vendor/yourgem"

Your gem must have a yourgem.gemspec or bundler still won't find it.

Alternatively, you can reference a git project. e.g.

gem "rails", :git => "git://github.com/rails/rails.git"

Then run bundle install.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜