【发布时间】:2014-02-01 10:10:08
【问题描述】:
尝试运行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 升级。
bundle install 命令在本地工作,但是当我 ssh 到目标服务器并运行此命令时会产生与上述相同的错误。
如果我运行gem list,我可以在宝石列表中看到它。
...
jquery-rails (3.0.4)
json (1.8.1)
less (2.3.2)
...
如果我在本地和目标服务器上尝试推荐的解决方案 gem install json -v '1.8.1',我会得到以下输出:
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 已安装,对吧?为什么会这样?我该如何解决这个问题?任何帮助将不胜感激。
【问题讨论】:
-
bundle show json给你什么? -
将
gem json, '1.8.1'添加到 Gemfile -
不幸的是,我的 gemfile 中有 gem json, '1.8.1'
-
bundle show json give /Users/ME/.rvm/rubies/ruby-2.1.0/lib/ruby/gems/2.1.0/gems/json-1.8.1
-
我的 Ubuntu 上需要
sudo apt-get install ruby-dev。
标签: ruby-on-rails gem capistrano bundler