Rails安装错误

时间:2015-07-09 21:46:55

标签: ruby-on-rails ruby rubygems

我正在尝试在Mac OS(Mavericks)上安装Rails,但出于某种原因,它不会让我失望。我已经安装了Ruby。这是我已经拥有的错误和一组宝石:

[~] ruby-2.2.1 $ sudo gem install rails
Password:
ERROR:  Error installing rails:
invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/garrettgalvin/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/cache/nokogiri-1.6.6.2.gem

actionview (4.2.3)
activesupport (4.2.3)
bigdecimal (1.2.6)
builder (3.2.2)
bundler (1.10.5)
bundler-unload (1.0.2)
erubis (2.7.0)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
i18n (0.7.0)
io-console (0.4.3)
json (1.8.1)
loofah (2.0.2)
mini_portile (0.6.2)
minitest (5.7.0)
psych (2.0.8)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6)
rails-html-sanitizer (1.0.2)
rake (10.4.2)
rdoc (4.2.0)
rubygems-bundler (1.4.4)
rubygems-update (2.4.8)
rvm (1.11.3.9)
thread_safe (0.3.5)
tzinfo (1.2.2)

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您永远不应该使用sudo安装宝石。

如果在安装软件包时出现任何gem损坏错误,则必须再次进行安装,并确保删除.rvm文件中的相应gem。 (搜索并删除具有该名称的所有宝石。)