【发布时间】:2014-08-12 16:23:40
【问题描述】:
当我尝试运行脚本来设置我的工作区时,我收到了这个错误
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find json (<= 1.6.1, >= 1.4.4) amongst [bigdecimal-1.1.0, bundler-1.1.5, bunny-0.7.9, chef-10.14.4, erubis-2.7.0, highline-1.6.15, io-console-0.3, ipaddress-0.8.0, jruby-pageant-1.1.1, json-1.8.1, mime-types-1.19, minitest-2.5.1, mixlib-authentication-1.3.0, mixlib-cli-1.2.2, mixlib-config-1.1.2, mixlib-log-1.4.1, mixlib-shellout-1.1.0, moneta-0.6.0, net-ssh-2.2.2, net-ssh-gateway-1.1.0, net-ssh-multi-1.1, ohai-6.14.0, polyglot-0.3.3, rake-0.9.2.2, rdoc-3.9.4, rest-client-1.6.7, systemu-2.5.2, treetop-1.4.10, uuidtools-2.1.3, yajl-ruby-1.1.0] (Gem::LoadError)
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `each'
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:in `activate'
from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems.rb:1232:in `gem'
from /opt/chef/bin/chef-solo:22:in `<main>'
you have a different version of chef installed and we don't support uninstalling them with this script, we only support version 10.14.4
我假设这意味着我需要 1.4.4 和 1.6.1 之间的 json 版本,所以我运行了这个语句
gem install json -v 1.6.1
这吐出来了....
WARNING: Error fetching data: Errno::ETIMEDOUT: Operation timed out - connect(2) (https://gem.vistacore.us:8443/gem/specs.4.8.gz)
WARNING: Error fetching data: Errno::ETIMEDOUT: Operation timed out - connect(2) (https://nexus.vistacore.us:8443/gem/specs.4.8.gz)
Fetching: json-1.6.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed json-1.6.1
1 gem installed
Installing ri documentation for json-1.6.1...
Installing RDoc documentation for json-1.6.1...
但是当我尝试重新运行我的工作区脚本时,我又遇到了第一个错误。就好像什么都没有安装一样。这是怎么回事?
谢谢!
【问题讨论】:
-
你的
Gemfile中有jsongem 吗? -
我没有 GemFile 目录,但我有一堆 GemFile,打开它们显示其中一些具有 json 1.8.1,而另一些似乎没有。跨度>
-
你
require "json"了吗? -
您能否运行
ruby -v和which ruby并将输出粘贴到此处? -
@sethvargo 我不确定你所说的 require "json" 是什么意思
标签: ruby-on-rails ruby json rubygems chef-infra