我有一个奇怪的问题,当我尝试运行vagrant up
系统时突然找不到 json gem。当我运行 vagrant up 时,我收到以下消息:
/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find json (~> 1.5.1) amongst [Platform-0.4.0, archive-tar-minitar-0.5.2, builder-3.0.0, bundler-1.1.5, childprocess-0.3.5, cucumber-1.2.1, diff-lcs-1.1.3, erubis-2.7.0, ffi-1.1.5, gemcutter-0.7.1, gherkin-2.11.2, git-1.2.5, hiera-0.3.0, hiera-json-0.3.0, hiera-puppet-0.3.0, highline-1.6.13, i18n-0.6.0, json-1.7.5, log4r-1.1.10, metaclass-0.0.1, mocha-0.12.3, net-scp-1.0.4, net-ssh-2.5.2, open4-1.3.0, popen4-0.1.2, progressbar-0.11.0, puppet-module-0.3.4, puppetlabs_spec_helper-0.3.0, rake-0.9.2.2, rspec-2.11.0, rspec-core-2.11.1, rspec-expectations-2.11.2, rspec-mocks-2.11.2, rspec-puppet-0.1.4, thor-0.16.0, vagrant-1.0.3, veewee-0.2.3, virtualbox-0.9.2] (Gem::LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/specification.rb:771:in `activate_dependencies'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/specification.rb:760:in `each'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/specification.rb:760:in `activate_dependencies'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/specification.rb:744:in `activate'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1209:in `gem'
from /usr/local/bin/vagrant:18
正如您从上面的错误中看到的,json gem 显然在列表中,但它不会识别它。我已经搜索过这个问题并发现了很多事件,但大多数时候 gem 不在列表中。我没有多次安装 ruby 并且设置了 gem 路径。
宝石环境
RubyGems 环境:
- 红宝石版本:1.8.15
- 红宝石版本:1.8.7(2011-06-30 补丁级别 352)[x86_64-linux]
- 安装目录:/var/lib/gems/1.8
- 红宝石可执行文件:/usr/bin/ruby1.8
- 可执行目录:/usr/local/bin
- 红宝石平台:
- 红宝石
- x86_64-linux
- 宝石路径:
- /var/lib/gems/1.8
- /home/adrian/.gem/ruby/1.8
- 宝石配置:
- :update_sources => 真
- :详细 => 真
- :基准 => 假
- :回溯 => 假
- :bulk_threshold => 1000
- 远程资源:
安装目录在 Ubuntu 12.04 上是默认的。
宝石清单
*当地宝石*
archive-tar-minitar (0.5.2)
builder (3.0.0)
bundler (1.1.5)
childprocess (0.3.5)
cucumber (1.2.1)
diff-lcs (1.1.3)
erubis (2.7.0)
ffi (1.1.5)
gemcutter (0.7.1)
gherkin (2.11.2)
git (1.2.5)
hiera (0.3.0)
hiera-json (0.3.0)
hiera-puppet (0.3.0)
highline (1.6.13)
i18n (0.6.0)
json (1.7.5)
log4r (1.1.10)
metaclass (0.0.1)
mocha (0.12.3)
net-scp (1.0.4)
net-ssh (2.5.2)
open4 (1.3.0)
Platform (0.4.0)
popen4 (0.1.2)
progressbar (0.11.0)
puppet-module (0.3.4)
puppetlabs_spec_helper (0.3.0)
rake (0.9.2.2)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.2)
rspec-puppet (0.1.4)
thor (0.16.0)
vagrant (1.0.3)
veewee (0.2.3)
virtualbox (0.9.2)
如您所见,gem 位于此处的已安装列表中。环境变量$GEM_HOME
和$GEM_PATH
未设置。
我一直试图弄清楚这一点,但目前不知所措。Ruby 和/或 Vagrant 专家的任何帮助将不胜感激。