我该如何修复这个错误? config.gem:在vendor/gems中解压的gem authlogic-2.1.3没有规范文件
我在启动我的 Mongrel 服务器时收到此错误...
$ script/server --debugger
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
config.gem: Unpacked gem authlogic-2.1.3 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
=> Debugger enabled
=> Call with -d to detach
=> Ctrl-C to shutdown server
当我运行 rake gems:refresh_specs 时,它表明我收到另一个错误:
rake aborted!
undefined method `installed_source_index' for #<Gem::SourceIndex:0x100551a58>
关于如何解决此问题的任何想法?
I get this error when launching my Mongrel server...
$ script/server --debugger
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
config.gem: Unpacked gem authlogic-2.1.3 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
=> Debugger enabled
=> Call with -d to detach
=> Ctrl-C to shutdown server
When I run rake gems:refresh_specs like it suggests I get another error though:
rake aborted!
undefined method `installed_source_index' for #<Gem::SourceIndex:0x100551a58>
Any thoughts on how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我不知道为什么它在 Authlogic 中被破坏,但我必须自己生成它。
在您的 Rails 项目中尝试一下:
$prompt> cd 供应商/gems/authlogic-2.1.3
$prompt>宝石规范 authlogic > 。规格
I am not sure why it is broken in Authlogic, but I had to generate it myself.
Try this in your Rails project:
$prompt> cd vendor/gems/authlogic-2.1.3
$prompt> gem specification authlogic > .specification
我只是想插话一下,因为我今天也经历了同样的事情,只不过宝石不同。
我正在更新 hoptoad 以使用通知程序作为 gem 而不是插件,Github 页面的说明之一是将 gem 解压到供应商/gems 中。
我在 Mac OS X 上,我这样解压 gem:
在我这样做之后,我得到了指定的错误,并且 gem 实际上并没有解压(它在供应商/gems 中创建了目录,但实际上并没有解压)打开宝石的包装)。
我从供应商/宝石中删除了该目录,然后再次尝试:
这次工作正常,解压正常,没有错误。
I'm just going to chime in here, because I experience the same thing today, except with a different gem.
I was updating hoptoad to use the notifier as a gem instead of a plugin, and one of the instructions from the Github page is to unpack the gem into vendor/gems.
I'm on Mac OS X, and I unpacked the gem as so:
After I did this, I got the error specified, and the gem didn't actually unpack (it created the directory in vendor/gems, but didn't actually unpack the gem).
I deleted the directory from vendor/gems, and tried again as:
Worked this time, unpacked properly, and no error.
我相信原因是这样的:
http://github.com/binarylogic/authlogic/commit/05e452472616bd60bb81affc75a1cb3d95cf7857
楼主是故意的在 .specation 文件上添加了 gitignore。
我猜你冻结了这个特定的 gem 并将其提交到供应商/gems/..下的代码分支中。正如预期的那样,git 忽略每个请求的这个特定文件
I believe this is the reason:
http://github.com/binarylogic/authlogic/commit/05e452472616bd60bb81affc75a1cb3d95cf7857
The owner purposely added the gitignore on the .specification file.
I'm guessing u freeze this particular gem and submit it in your code branch under vendor/gems/..and as expected, git ignore this particular file per request
我必须进入vendor/gems/authlogic并从.gitignore中删除'.specation'
一旦你完成了,你就可以运行 rake gems:refresh_specs
唯一的问题是,下次你升级这个gem时,坏的.gitignore会回来
I had to pop into vendor/gems/authlogic and remove '.specification' from the .gitignore
Once you've done that you can run rake gems:refresh_specs
Only problem is that the next time you upgrade this gem the bad .gitignore comes back
我也遇到了同样的“未知的 GEM”问题。经过一番折腾后,我发现了以下秘诀:
首先,我使用标准的“gem install authlogic”安装了 gem,它将 gem 放置在 /Library/Ruby/Gems/1.8 中。
在 RadRails 中,我使用了 rake 任务“gems:unpack”,它似乎收集了与您的应用程序相关的所有 gem,并根据需要将它们放置在 /vendor/gems 中。
然后我卸载了系统范围的 gem 以检查它是否确实有效: gem uninstall authlogic --install-dir=/Library/Ruby/Gems/1.8
似乎运行良好。
I had the same "unknown GEM" problems. After much faffing about I found the following recipe :
First, I installed the gem using the standard "gem install authlogic", which placed the gem in /Library/Ruby/Gems/1.8.
Within RadRails, I used the rake task "gems:unpack" which seems to gather all the gems relevant to your app and place them in /vendor/gems as desired.
I then uninstalled the system wide gem to check it has really worked with : gem uninstall authlogic --install-dir=/Library/Ruby/Gems/1.8
Seems to work well.
在生成 .specation 文件之前构建并安装 gem
$prompt> cd 供应商/gems/authlogic-2.1.3
$prompt> gem build authlogic.gemspec
$prompt> gem install authlogic.gemspec
$prompt>宝石规范 authlogic > 。规格
Build and install the gem before generating the .specification file
$prompt> cd vendor/gems/authlogic-2.1.3
$prompt> gem build authlogic.gemspec
$prompt> gem install authlogic.gemspec
$prompt> gem specification authlogic > .specification