2015-09-22 167 views
2

我有這個問題,同時打開 - >軌控制檯權限被拒絕@ dir_s_mkdir - /運行/用戶/ GUI /春(錯誤:: EACCES)

[[email protected] todo_app]$ rails c 
/home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir': Permission denied @ dir_s_mkdir - /run/user/gui/spring (Errno::EACCES) 
    from /home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:252:in `fu_mkdir' 
    from /home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:226:in `block (2 levels) in mkdir_p' 
    from /home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:224:in `reverse_each' 
    from /home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:224:in `block in mkdir_p' 
    from /home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:210:in `each' 
    from /home/chitra/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/fileutils.rb:210:in `mkdir_p' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/env.rb:37:in `tmp_path' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/env.rb:54:in `pidfile_path' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/env.rb:69:in `server_running?' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/client/run.rb:25:in `call' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/client/command.rb:7:in `call' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/client/rails.rb:24:in `call' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/client/command.rb:7:in `call' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/client.rb:28:in `run' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/bin/spring:49:in `<top (required)>' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `load' 
    from /home/chitra/.rvm/gems/[email protected]/gems/spring-1.4.0/lib/spring/binstub.rb:11:in `<top (required)>' 
    from /opt/projects/todo_app/bin/spring:13:in `require' 
    from /opt/projects/todo_app/bin/spring:13:in `<top (required)>' 
    from bin/rails:3:in `load' 
    from bin/rails:3:in `<main>' 

我使用的紅寶石版本2.2.0p0和軌道4.2。 任何幫助,將不勝感激。

+0

授予訪問該目錄,或取消XDG_RUNTIME_DIR'須藤喬敦 - R的奇特拉/運行/用戶/ GUI/spring' – dimakura

回答

4

這裏是的投擲的錯誤代碼:

# File 'lib/spring/env.rb', line 35 

def tmp_path 
    path = Pathname.new(File.join(ENV['XDG_RUNTIME_DIR'] || Dir.tmpdir, "spring")) 
    FileUtils.mkdir_p(path) unless path.exist? 
    path 
end 

看起來你有XDG_RUNTIME_DIR設置爲/run/user/gui/但服務器沒有該目錄的寫入權限。所以,你可以通過輸入unset XDG_RUNTIME_DIR

+0

或者將其設置爲是你:'出口XDG_RUNTIME_DIR = $ {ID -u}'。 – FaithReaper

相關問題