捆绑安装错误:源不包含任何版本

时间:2022-11-28 14:53:38

My gem file contains:

我的gem文件包含:

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.

第一个gem按预期安装,但第二个失败。

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

类似的帖子指出缺少.gemspec文件,但此文件存在。 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

我将repo克隆到vendor / plugins文件夹并更改了我的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

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

3 个解决方案

#1


23  

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

正如马塞洛所说,我得到了同样的错误,这是一个愚蠢的事情:

gemspec file

gemspec文件

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)...

你可以在我的gemspec中看到我使用(“_”)下划线命名并在我的gemfile上我试图用“ - ”(短划线)来调用它...

(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

(掌上)所以只需要处理名称表示法,你在gemspec文件中声明的那个与你在另一个项目的gem文件中用于调用的那个可能是不同的

#2


10  

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.

我遇到了与Rails 4.2类似的问题。在我的情况下,这是另一个愚蠢的错误。看来如果你在gemspec文件的注释中留下“TODO”或“FIXME”,它将拒绝该gem并将抛出相同的错误。请务必阅读bundle命令的输出。

#3


5  

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

gemspec文件名为simplemenu.gemspec而不是simple_menu.gemspec。

#1


23  

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

正如马塞洛所说,我得到了同样的错误,这是一个愚蠢的事情:

gemspec file

gemspec文件

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)...

你可以在我的gemspec中看到我使用(“_”)下划线命名并在我的gemfile上我试图用“ - ”(短划线)来调用它...

(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

(掌上)所以只需要处理名称表示法,你在gemspec文件中声明的那个与你在另一个项目的gem文件中用于调用的那个可能是不同的

#2


10  

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.

我遇到了与Rails 4.2类似的问题。在我的情况下,这是另一个愚蠢的错误。看来如果你在gemspec文件的注释中留下“TODO”或“FIXME”,它将拒绝该gem并将抛出相同的错误。请务必阅读bundle命令的输出。

#3


5  

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

gemspec文件名为simplemenu.gemspec而不是simple_menu.gemspec。