2012-08-28 26 views
4

我有一個奇怪的問題,即當我嘗試運行vagrant up系統會突然找不到JSON寶石。當我運行無業遊民了,我得到這個消息:紅寶石找不到寶石之中,即使它是在列表中

/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寶石顯然是在列表中,但它不會承認它。我搜索了這個問題,並發現了許多事件,而是大部分時間創業板沒有出現在名單之中。我沒有多次安裝ruby,並且設置了寶石路徑。

寶石的env

RubyGems的環境:

  • RubyGems的VERSION:1.8.15
  • RUBY VERSION:1.8.7(2011-06-30 PATCHLEVEL 352)[x86_64的Linux的]
  • 安裝目錄:/var/lib/gems/1.8
  • Ruby可執行文件:/usr/bin/ruby1.8
  • 可執行文件目錄:在/ usr/local/bin目錄
  • PLATFORMS的rubygems:
    • 紅寶石
    • x86_64的Linux的
  • GEM PATHS:
    • /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_HOME$GEM_PATH未設置。

我一直在試圖找出這一個,但處於虧損狀態我目前。任何來自Ruby和/或Vagrant專家的幫助將不勝感激。

回答

4

正如您在這裏指出的那樣,您已經安裝了json gem版本1.7.5。但是您收到的錯誤消息是Could not find json (~> 1.5.1)~>語法意味着只有1.5.x版本可以接受!所以,你需要安裝其中的一個來滿足依賴關係。

+0

工作完美!非常感謝你的幫助! –