2015-04-05 93 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