Bundle install error: Source does not contain any

2019-04-18 04:24发布

My gem file contains:

gem "breadcrumb", :git => "git@github.com:mjacobus/Breadcrumb.git"

gem "simple_menu", :git => "git@github.com:mjacobus/simple_menu.git"

The first gem installs as expected, but the second one fails.

Updating git@github.com:mjacobus/simple_menu.git
Fetching gem metadata from https://rubygems.org/........
Could not find gem 'simple_menu (>= 0) ruby' in git@github.com:mjacobus/simple_menu.git (at master).
Source does not contain any versions of 'simple_menu (>= 0) ruby'

Similar posts points to the lack of the .gemspec file, but this file exists. https://github.com/mjacobus/simple_menu/blob/master/simple_menu.gemspec

I am probably doing something stupid that someone else's eyes will be able to see.

edit

I cloned the repo into the vendor/plugins folder and changed my Gemfile

gem "simple_menu", :path => "vendor/plugins/simple_menu"

Bundle install issues now the error:

bundle install
Fetching gem metadata from https://rubygems.org/.......
Could not find gem 'simple_menu (>= 0) ruby' in source at vendor/plugins/simple_menu.
Source does not contain any versions of 'simple_menu (>= 0) ruby'

edit 2

I knew it was a stupid error. The gem name was not correct.

https://github.com/mjacobus/simple_menu/commit/1afca04b08a084dafb9bdf6e595a2bb9a7b7a55f

3条回答
smile是对你的礼貌
2楼-- · 2019-04-18 05:07

I ran into a similar problem with Rails 4.2. In my case it was another stupid mistake. It appears that if you leave "TODO" or "FIXME" in the comments in gemspec file, it will reject that gem and will throw the same error. Be sure to read the output of bundle command.

查看更多
做自己的国王
3楼-- · 2019-04-18 05:13

As Marcelo mentioned, I got same error and it was a stupid thing:

gemspec file

Gem::Specification.new do |s|
 s.name = 'niche_wir_theme' 
 ....

Gem file (include)

gem 'niche-wir-theme', :git => 
....

As you can see in my gemspec i named using ("_") underscore and on my gemfile i was trying to call it with "-" (dash)...

(palmface) so just take care of the name notation, the one you are declaring at gemspec file against the one you use for the call in the gem file of the other project are probably different

查看更多
Melony?
4楼-- · 2019-04-18 05:30

The gemspec file as named simplemenu.gemspec instead of simple_menu.gemspec.

查看更多
登录 后发表回答