2012-01-29 56 views
0

當我運行Rails新的應用程序......我得到這個錯誤軌新的錯誤

/Library/Ruby/Site/1.8/rubygems/specification.rb:542:in `read': Permission denied - /Library/Ruby/Gems/1.8/specifications/coffee-script-source-1.2.0.gemspec (Errno::EACCES) 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:542:in `load' 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:269:in `_all' 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:268:in `each' 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:268:in `_all' 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:267:in `reverse_each' 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:267:in `_all' 
from /Library/Ruby/Site/1.8/rubygems/specification.rb:409:in `each' 
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:216:in `find_all' 
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:216:in `matching_specs' 
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:238:in `to_specs' 
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:256:in `to_spec' 
from /Library/Ruby/Site/1.8/rubygems.rb:1208:in `gem' 
from /usr/bin/rails:18 

我可以繞過這通過以root身份運行,但是當我這樣做有問題。爲什麼我得到這個錯誤/我該如何解決它?

回答

1

使用RVM。它會讓你的生活變得更輕鬆。問題是您的普通用戶帳戶無權訪問該文件。默認情況下,RVM以安裝RVM的用戶的身份存儲gem和ruby文件,因此不應該有任何問題。你可以用這種方式輕鬆切換Ruby版本,我建議升級到1.9.3。