2015-06-16 196 views
0

我在捆綁安裝過程中遇到了一些錯誤。我跑的命令/home/tanmay/.rvm/gems/[email protected]/bin/bundle install在rails中捆綁安裝錯誤

下面是錯誤的詳細信息:

Errno::EACCES: Permission denied - /home/circar 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir' 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir' 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p' 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each' 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p' 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:203:in `each' 
    /home/tanmay/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler.rb:308:in `mkdir_p' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/installer.rb:287:in `create_bundle_path' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/installer.rb:54:in `run' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/installer.rb:18:in `install' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/cli/install.rb:107:in `run' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/cli.rb:158:in `install' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/lib/bundler/cli.rb:10:in `start' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/bin/bundle:20:in `block in <top (required)>' 
    /home/tanmay/.rvm/gems/ruby[email protected]/gems/bundler-1.10.3/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors' 
    /home/tanmay/.rvm/gems/[email protected]/gems/bundler-1.10.3/bin/bundle:18:in `<top (required)>' 
    /home/tanmay/.rvm/gems/[email protected]/bin/bundle:23:in `load' 
    /home/tanmay/.rvm/gems/[email protected]/bin/bundle:23:in `<main>' 
    /home/tanmay/.rvm/gems/[email protected]/bin/ruby_executable_hooks:15:in `eval' 
    /home/tanmay/.rvm/gems/[email protected]/bin/ruby_executable_hooks:15:in `<main>' 

環境

Bundler 1.10.3 
Rubygems 2.1.11 
Ruby  2.0.0p353 (2013-11-22 revision 43784) [i686-linux] 
GEM_HOME /home/circar/.gem/ruby/2.0.0/ruby/2.0.0 
GEM_PATH 
RVM  1.26.11 (master) 
Git  1.7.9.5 

捆紮機設置:

without 
    Set for your local app (/home/tanmay/amit_rails/circarindia/.bundle/config): "development:test" 
disable_shared_gems 
    Set for your local app (/home/tanmay/amit_rails/circarindia/.bundle/config): "1" 
path 
    Set for your local app (/home/tanmay/amit_rails/circarindia/.bundle/config): "/home/circar/.gem/ruby/2.0.0" 

UPDATE 我的包後,安裝運行正常se命令。

RM -rf〜/ .bundle /〜/ .gem/ 室射頻$ GEM_HOME /捆紮機/, 室射頻.bundle /, 室射頻供應商/緩存/, 室射頻的Gemfile。鎖, 但我不明白這些命令。這個命令是什麼? 在此先感謝

+0

看起來你是以錯誤的用戶身份登錄的:你在'/ home/tanmay'中,但是腳本試圖寫入'/ home/circar'中的gems文件夾,因爲GEM_HOME被設置爲'/家庭/ circar'。你實際登錄了哪個用戶?如果兩個用戶需要互相寫入主文件夾,則可以將它們放在一個組中,並確保這些文件夾都具有組寫入權限。 –

+0

但經過RM -rf〜/ .bundle /〜/ .gem/ 室射頻$ GEM_HOME /捆紮機/ 室射頻.bundle/ 室射頻供應商/緩存/ 室射頻Gemfile.lock的 – AGM

+0

後這些comand運行bundle安裝正常。 – AGM

回答

0

Ruby或環境配置中存在錯誤。您登錄爲tanmay和你的主目錄是

/home/tanmay/ 

但束試圖寫入到另一個用戶主目錄路徑

/home/circar/ 

GEM_HOME不正確。

GEM_HOME /home/circar/.gem/ruby/2.0.0/ruby/2.0.0 

請確保您沒有複製/粘貼某個配置文件逐字從同事。如果您找不到該問題,則可能需要刪除並重新安裝RVM。

還要確保您的.bash_profile,.profile(或您使用的任何env文件)中的PATH是正確的,並且不指向另一個家庭用戶目錄。

+0

但是當我在終端運行一些命令然後捆綁安裝運行fine.these命令是rm -rf〜/ .bundle /〜/ .gem/ rm -rf $ GEM_HOME/bundler /, rm -rf .bundle /, rm -rf vendor/cache /, rm -rf Gemfile.lock, – AGM

+0

這個命令是什麼。我不明白這些命令。 – AGM

+0

我沒有寫任何命令。我解釋了你的配置有什麼問題。你將不得不調查你的配置。 –