cameronnc@cameron-20fms3pk00]─[~/Desktop/snetwork]
└──╼ $bundle exec rails db:create
Rails Error: Unable to access log file. Please ensure that /home/cameronnc/Desktop/snetwork/log/development.log exists and is writable (i.e. make it writable for user and group: chmod 0664 /home/cameronnc/Desktop/snetwork/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
rails aborted!
Errno::EACCES: Permission denied @ rb_sysopen - /home/cameronnc/Desktop/snetwork/config/master.key
/home/cameronnc/Desktop/snetwork/config/environment.rb:5:in `<main>'
Tasks: TOP => db:create => db:load_config => environment
(See full trace by running task with --trace)
I am trying to create my db in rails and want to use the latest version of Ruby and rails but I get many many permission errors. I wasn't even allowed to modify my gem files unless I signed in as root. How can I fix this error?
So I ran the following commands BUT I still get an error message of some kind:
[✗]─[cameronnc@cameron-20fms3pk00]─[~/Desktop/snetwork]
└──╼ $rails db:create
Rails Error: Unable to access log file. Please ensure that /home/cameronnc/Desktop/snetwork/log/development.log exists and is writable (i.e. make it writable for user and group: chmod 0664 /home/cameronnc/Desktop/snetwork/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
FATAL: role "cameronnc" does not exist
Couldn't create 'snetwork_development' database. Please check your configuration.
rails aborted!
ActiveRecord::ConnectionNotEstablished: FATAL: role "cameronnc" does not exist
Caused by:
PG::ConnectionBad: FATAL: role "cameronnc" does not exist
Tasks: TOP => db:create
(See full trace by running task with --trace)
┌─[✗]─[cameronnc@cameron-20fms3pk00]─[~/Desktop/snetwork]
└──╼ $sudo su
┌─[root@cameron-20fms3pk00]─[/home/cameronnc/Desktop/snetwork]
└──╼ #sudo -u postgres createuser --superuser cameronnc
┌─[root@cameron-20fms3pk00]─[/home/cameronnc/Desktop/snetwork]
└──╼ #exit
exit
┌─[cameronnc@cameron-20fms3pk00]─[~/Desktop/snetwork]
└──╼ $bundle exec rails db:create
Rails Error: Unable to access log file. Please ensure that /home/cameronnc/Desktop/snetwork/log/development.log exists and is writable (i.e. make it writable for user and group: chmod 0664 /home/cameronnc/Desktop/snetwork/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
(866.0ms) CREATE DATABASE "snetwork_development" ENCODING = 'unicode'
Created database 'snetwork_development'
(684.0ms) CREATE DATABASE "snetwork_test" ENCODING = 'unicode'
Created database 'snetwork_test'
Why am I receiving a:
$bundle exec rails db:create Rails Error: Unable to access log file. Please ensure that /home/cameronnc/Desktop/snetwork/log/development.log exists and is writable (i.e. make it writable for user and group: chmod 0664 /home/cameronnc/Desktop/snetwork/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
What is going on and how can I address such an odd error?