[英]Ruby error, can't start the rails server
I get this error when I run rails s
. 运行
rails s
时出现此错误。
Can anyone help me? 谁能帮我?
Rails Error: Unable to access log file.
Rails错误:无法访问日志文件。 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.
请确保/Users/delejnr/Desktop/ruby_playground/observe/log/development.log存在并且为chmod0666。日志级别已提升为WARN,输出已定向至STDERR,直到问题解决。 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!'退出/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
!: 345:in check_pid!' from /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:246:instart' 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:inblock 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 `'来自/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
从开始/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'从/Library/Ruby/Gems/2.0block in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in
.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`'
You don't have permission for that file(s). 您没有该文件的权限。
Start as admin / sudo and check the file permissions and adjust them accordingly. 以admin / sudo身份启动,然后检查文件权限并相应地进行调整。
Also make sure that file( /Users/delejnr/Desktop/ruby_playground/observe/log/development.log
) even exists. 还要确保文件(
/Users/delejnr/Desktop/ruby_playground/observe/log/development.log
)甚至存在。
I received this error and ran the following command to fix the permissions: 我收到此错误,并运行以下命令来修复权限:
sudo chmod 0664 <path to app>/<name of app>/log/development.log
Replace <path to app> and <name of app> 替换<应用程序的路径>和<应用程序的名称>
in your case 在你的情况下
sudo chmod 0664 /Users/delejnr/Desktop/ruby_playground/observe/log/development.log
For Mac 10.11.5 对于Mac 10.11.5
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.