为什么不打包器安装JSON宝石? [英] Why won't bundler install JSON gem?

查看:106
本文介绍了为什么不打包器安装JSON宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试运行 cap production deploy 时出现以下错误。

I get the following error when attempting to run cap production deploy.

DEBUG [dc362284]    Bundler::GemNotFound: Could not find json-1.8.1.gem for installation
DEBUG [dc362284]    An error occurred while installing json (1.8.1), and Bundler cannot continue.
DEBUG [dc362284]    Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

可能很重要的一点是这个部署工作正常,比我升级到Ruby 2.1.0删除编码错误。我本地升级,工作正常。我运行了 rvm install 2.1.0 rvm use 2.1.0 然后更改了我的 .ruby -version 文件来反映这个Ruby升级。

It may be important to note that this deployment was working, than I upgraded to Ruby 2.1.0 to remove an encoding error. I upgraded locally which worked fine. I ran rvm install 2.1.0 and rvm use 2.1.0 then changed my .ruby-version file to reflect this Ruby upgrade.

bundle install ,但当我到目标服务器ssh并运行此命令时产生相同的上述错误。

The bundle install command works locally, but produces the same above error when I ssh onto the destination server and run this command.

如果我运行 gem list ,我可以在宝石列表中看到。

If I run gem list I can see this in the list of gems.

...
jquery-rails (3.0.4)
json (1.8.1)
less (2.3.2)
...

如果我尝试推荐的解决方案 gem install json -v'1.8.1'在本地和目标服务器上,我得到以下输出:

If I try the recommended solution gem install json -v '1.8.1' Locally and on the destination server I get the following output:

Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
Done installing documentation for json after 0 seconds
1 gem installed

所以看起来gem已经安装了,对不对?这是为什么发生?我该如何解决这个问题?任何帮助将不胜感激。

So it appears the gem is installed, right? Why is this happening? How can I solve this? Any help would be greatly appreciated.

推荐答案

因此,在发布我的问题几乎立即发布半天后,我找到了答案。 Bundler 1.5.0有一个错误,它无法识别默认宝石,因为此处引用

So after a half day on this and almost immediately after posting my question I found the answer. Bundler 1.5.0 has a bug where it doesn't recognize default gems as referenced here

解决方案是使用 gem install bundler -v'= 1.5.1'

这篇关于为什么不打包器安装JSON宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆