I have built a rails app on my local machine and would like to deploy it, following the tutorial here: https://www.digitalocean.com/community/tutorials/how-to-launch-your-ruby-on-rails-app-with-the-digitalocean-one-click-image
However, after uploading the whole app through SFTP, creating a postgresql user named ‘postgres’ (I did this to get around the peer authentication error), running the command
RAILS_ENV=production rake db:migrate
as the UNIX user postgres gave me the following errors:
Rails Error: Unable to access log file. Please ensure that /home/rails/log/production.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. rake aborted! Errno::EACCES: Permission denied - /home/rails/db/schema.rb
I have spent quite a bit of time googling around but no luck. Please help.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
The issue you’re seeing is due to the fact that you are running the command as the user postgres who doesn’t have permissions to access
/home/rails/db/schema.rb
Instead of runningrake
as the UNIX user postgres, create a postgres user/password for your Rails app:Then in your
database.yml
file:You need to change app folder files permission as:
sudo chown -R jsingh /var/www/
@asb I am having the same issue even after following this solution. it still says:
Can you help me on this.