Ruby

Vagrant - 由於找不到“圖書管理員”而無法啟動實例(即使已安裝)

  • June 20, 2013

我遇到了一個很奇怪的問題,基本上我輸入“vagrant up”,我立即看到:

Gem "Librarian" was not found. Try running `vagrant gem install librarian --no-ri --no-rdoc`

當然,輸入上述命令(帶或不帶 sudo)沒有區別。事實上,librarian 已經安裝好了,請看這裡的列表:

*** LOCAL GEMS ***

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13, 3.2.12)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13, 3.2.12)
addressable (2.3.4, 2.3.3)
archive-tar-minitar (0.5.2)
arel (3.0.2)
berkshelf (1.1.6)
builder (3.0.4)
bundler (1.3.5)
bunny (0.7.9)
capistrano (2.14.2)
celluloid (0.13.0)
chef (11.4.0, 10.16.2)
childprocess (0.3.9)
chozo (0.6.1)
erubis (2.7.0)
faraday (0.8.7, 0.8.6)
ffi (1.7.0, 1.5.0)
hashie (2.0.3)
highline (1.6.18, 1.6.16)
hike (1.2.2)
hipchat (0.8.0)
httparty (0.11.0, 0.10.2)
i18n (0.6.4, 0.6.1)
ipaddress (0.8.0)
journey (1.0.4)
json (1.7.7, 1.6.1)
librarian (0.1.0)
log4r (1.1.10)
mail (2.5.3)
mime-types (1.22, 1.21)
minitar (0.5.4)
mixlib-authentication (1.3.0)
mixlib-cli (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.6.0, 1.4.1)
mixlib-shellout (1.1.0)
moneta (0.6.0)
multi_json (1.7.2, 1.7.1)
multi_xml (0.5.3)
multipart-post (1.2.0)
net-http-persistent (2.8)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.7, 2.2.2)
net-ssh-gateway (1.1.0)
net-ssh-multi (1.1)
ohai (6.16.0)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railsless-deploy (1.1.0, 1.0.2)
railties (3.2.13)
rake (10.0.4)
rdoc (3.12.2)
rest-client (1.6.7)
ridley (0.6.3)
rubygems-bundler (1.1.1)
rvm (1.11.3.7)
solve (0.4.2)
sprockets (2.2.2)
systemu (2.5.2)
thor (0.18.1, 0.16.0)
tilt (1.3.7)
timers (1.1.0)
treetop (1.4.12)
tzinfo (0.3.37)
uuidtools (2.1.3)
vagrant (1.0.7)
vagrant-librarian (0.1.1)
yajl-ruby (1.1.0)

這是我的 Gemfile:

source 'https://rubygems.org'

gem 'vagrant'
gem 'librarian'
gem 'vagrant-librarian'
gem "berkshelf", "~>1.1.0"

有人對我下一步如何進行有任何想法嗎?我真的不知道如何讓這個工作。我也嘗試過“捆綁更新”和“捆綁安裝”,但這沒有幫助。

注意:我在 OS X 10.8.2 上使用 vagrant 1.0.6 和 ruby​​ 1.8.7

提前致謝!〜喬什

如果您查看 Vagrantfile,您會發現該錯誤消息。當引發任何異常時,這是一個包羅萬象的錯誤。如果 gem 因任何原因無法載入,它將發送此錯誤消息。由於它指定了庫管理器版本 0.0.26,如果安裝了不同版本的 gem,它將失敗並出現相同的錯誤。

修復是更新 Gemfile 並指定所需的圖書管理員版本:

gem 'librarian', '~> 0.0.26'

然後

bundle update

最後

vagrant up

引用自:https://serverfault.com/questions/500937