2013-10-17 29 views
2

在Mac 10.8.5上運行VMWare Fusion 6。試圖安裝vagrant-vmware-fusion插件並得到這個錯誤。我認爲這是一個紅寶石問題,但我不確定,因爲我沒有使用Ruby的經驗。任何幫助將非常感激。未定義的方法大小爲零:NilClass在gem install中

vagrant plugin install vagrant-vmware-fusion 
Installing the 'vagrant-vmware-fusion' plugin. This can take a few minutes... 
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader/entry.rb:127:in `read': undefined method `size' for nil:NilClass (NoMethodError) 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader/entry.rb:126:in `read' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader/entry.rb:126:in `read' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:73:in `block (2 levels) in from_io' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:64:in `block in each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `loop' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:138:in `block (2 levels) in each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:28:in `new' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:137:in `block in each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:64:in `block in each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `loop' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:132:in `each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:66:in `block in from_io' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:22:in `open' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package.rb:44:in `open' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:62:in `from_io' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:46:in `block in from_file_by_path' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:45:in `open' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:45:in `from_file_by_path' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:119:in `format' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:129:in `spec' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:386:in `ensure_required_ruby_version_met' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:156:in `install' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:297:in `block in install' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each_with_index' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `install' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/install_gem.rb:49:in `block in call' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment' 
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in `use_ui' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/gem_helper.rb:41:in `with_environment' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/install_gem.rb:39:in `call' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/bundler_check.rb:20:in `call' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:in `call' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `block in run' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in `busy' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `run' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/base.rb:17:in `action' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/install.rb:27:in `execute' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/root.rb:52:in `execute' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/cli.rb:38:in `execute' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/environment.rb:478:in `cli' 
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/bin/vagrant:96:in `<top (required)>' 
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load' 
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>' 
+0

stackoverflow.com是編程問題。您可能會在http://superuser.com/ – 2013-10-17 22:04:38

+0

上得到更好的答案。可能下載的gem已損壞。嘗試從〜/ .vagrant.d/gems/gems中刪除它並重試。 – Emyl

+0

聯繫支持人員。你已經與插件一起購買它。米切爾(根據我的經驗)非常敏感 – StephenKing

回答

0

正確的答案是,上面說的其他人:寶石包壞了,你需要從互聯網源獲得一個合適的包,然後安裝它。 Here是類似的問題,寶石作家建議只更新寶石:

錯誤似乎發生在gem包的「untarring」期間。這似乎表明它試圖解壓的軟件包文件已損壞。鑑於untar源代碼在rubygems中兩年內沒有改變,並且對其他人來說工作正常,所以問題與您的安裝有關。

在你的情況下,所有其他寶石工作正常,所以只有這個文件已損壞。我認爲在下載/解壓縮文件時出現問題。它可能已經將這個損壞的文件存儲在某個地方。您可能需要確定它的位置,以便刪除它。隨後,RubyGems的應該嘗試重新下載,之後安裝應該按預期工作

因此,作爲人勸刪除所有cachged包:

$ find -name "package.gem" -exec rm -f {} \; 

然後地方下載寶石你有良好的互聯網線路:

$ gem fetch package.gem 

複製到寶石源項目文件夾,然後再進行安裝:

$ gem install ./package.gem 

如果安裝成功複製到捆綁緩存(在我的情況下,它在.bundle文件夾中居住),因此:

$ mv ./package.gem ./.bundle/cache/ 

然後發出bundle

$ bundle 
相關問題