Rails Error: Unable to access log file. Please ensure that /home…/log/development.log exists and is chmod 0666

时光怂恿深爱的人放手 提交于 2019-12-23 09:38:20

问题


Im trying to migrate a db2 database to Ruby on Rails, but just when I run rails g scaffold, I get this:

Rails Error: Unable to access log file. Please ensure that /home/.../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.

I have checked and my development.log does not exist! I'm not sure why, since I followed every step during the installation, but still my file doesn't exist. How can I create it? I have already tried uninstalling and installing Rails again, but the problem remains.


回答1:


Maybe just do what it asks you to do?:

$ touch the_required_path/development.log
$ chmod 0666  the_required_path/development.log



回答2:


I've always had success with the the log file permissions as 644. When this has happened to me, more than once I might add, it has always been answered by the question linked below. Since this is the first answer in Google for the query I use, I'm linking to the answer that I really want.

Rails: Unable to access log file



来源:https://stackoverflow.com/questions/20319355/rails-error-unable-to-access-log-file-please-ensure-that-home-log-developm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!