2015-04-05 90 views
0

我運行rails s時出現此錯誤。Ruby錯誤,無法啓動rails服務器

任何人都可以幫助我嗎?

Rails Error: Unable to access log file. Please ensure that /Users/delejnr/Desktop/ruby_playground/observe/log/development.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed. Exiting /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:345:in delete': Permission denied - /Users/delejnr/Desktop/ruby_playground/observe/tmp/pids/server.pid (Errno::EACCES) from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:345:in check_pid!' from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:246:in start' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands/server.rb:84:in start' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:76:in block in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in tap' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in <top (required)>' from bin/rails:4:in require' from bin/rails:4:in `'

回答

2

您沒有該文件的權限。

以admin/sudo身份啓動並檢查文件權限並相應地調整它們。

還要確保文件(/Users/delejnr/Desktop/ruby_playground/observe/log/development.log)甚至存在。

+0

可以請你看看我最新的問題,你似乎專家在鐵軌。 – user1010101 2015-04-05 20:31:48

+0

非常感謝,它存在但我如何檢查文件的權限? – 2015-04-06 05:41:56

+0

@DeleJnrEribo你在運行什麼操作系統? – deW1 2015-04-06 13:38:50

0

我收到此錯誤,運行以下命令修復權限:

sudo chmod 0664 <path to app>/<name of app>/log/development.log 

更換<路徑在你的情況到App應用>

的>和<名

sudo chmod 0664 /Users/delejnr/Desktop/ruby_playground/observe/log/development.log 

適用於Mac 10.11.5