2014-01-13 88 views
1

無論何時我在我的所有rails應用程序上鍵入任何命令,我都會收到以下錯誤。我在雲9中的虛擬機上工作。任何想法或指導?Ruby on Rails(Errno :: EACCES)

(master) $ bundle exec rspec spec/ 
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `read': Permission denied - /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/specifications/multi_json-1.8.4.gemspec (Errno::EACCES) 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `load' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:269:in `block (2 levels) in _all' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `each' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:268:in `block in _all' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `each' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:267:in `_all' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:410:in `each' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `find_all' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:216:in `matching_specs' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:238:in `to_specs' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec' 
     from /opt/rh/ruby193/root/usr/share/rubygems/rubygems.rb:1231:in `gem' 
     from /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/bin/bundle:22:in `<main>' 

回答

2

這聽起來像你的寶石用sudo訪問安裝,它當前的用戶(網絡亞軍?)缺乏正確的燙髮看到Ruby的安裝目錄。

我不太清楚爲什麼寶石安裝到了像/usr/libexec/openshift/cartridges這樣的路徑 - 也許這是您的雲主機設置的一部分?

  1. 你是否從你的實例啓動你自己的rails服務器?例如像你自己安裝Unicorn,nginx等?如果是這樣,您可以使用rbenv將ruby和gemset安裝到您擁有完全權限控制的本地路徑。

如果您沒有上述方案#1,則主機可能會錯誤地配置安裝程序,並且應打開票證。

+1

謝謝你的回覆。爲了啓動一個rails服務器,我使用下面的命令:rails s -p $ PORT -b $ IP。但是,該命令在我所有的應用程序上發生了錯誤。我會打開一張票,也許他們可以有一個解決方案。 – Loic

+0

由於您啓動了自己的服務器,因此應該考慮控制您的ruby和gemset。請參閱安裝說明a [rbenv on GitHub](https://github.com/sstephenson/rbenv)。 ***一旦你這樣做安裝你的錯誤應該停止*** –

+0

@Loic特赦,但我也可以讓你upvote答案?我[我的聲譽得分有一個錯誤](http://meta.stackexchange.com/questions/215953/i-seem-to-have-lost-over-2500-today-could-this-be-on目的),我被告知投票會重置它。以這種方式想一下,一票將會給我2600+的聲譽;)如果你覺得這樣更公平,你可以低估我 –