Hi, I set up Discourse without Docker, or at least wanted to until I got to this step:
bundle exec rake db:create
Errno::EACCES: Permission denied @ rb_sysopen - /home/discourse/tmp/ember-rails/ember.js
In a support thread titled “Errno::EACCES: Permission denied on new Ubuntu development setup,” Justman10000 reports encountering a permission error while trying to set up Discourse without Docker, specifically when running bundle exec rake db:create. pfaffman suggests the issue may stem from insufficient database creation rights, even though Justman10000 claims to have granted superuser privileges and followed the Beginner’s Guide to Install Discourse on Ubuntu for Development. pfaffman theorizes a mismatch between the created user and the active user. The issue is resolved when Justman10000 discovers non-writable files in the Discourse directory and fixes them with chmod -R 777 .. pfaffman confirms the fix and asks if everything is working, to which Justman10000 replies affirmatively — only to immediately encounter a new error: ActiveRecord::ConnectionNotEstablished, traced to connection handling in Rails Multisite and scheduler threads Justman10000. The thread ends unresolved on this new issue.
Hi, I set up Discourse without Docker, or at least wanted to until I got to this step:
bundle exec rake db:create
Errno::EACCES: Permission denied @ rb_sysopen - /home/discourse/tmp/ember-rails/ember.js
Which development guide are you following?
I think the problem is that your user doesn’t have rights to create a database.
I know, even though I gave the user superuser rights! And I followed this guide!
My best guess is that the user you created and the user that it’s using are not the same. Not sure what else to tell you, though.
Ah, found out! Some files in the Discourse directory were not writable!
chmod -R 777 .
Great! I figured it was something silly, but there are so many little things that it could be!
So you’re all set now?
Yes, it’s solved! Small things can make a big difference!
For this there is now a new mistake (unbelievable
!):
#<Thread:0x000055c972f94c78 /home/discourse/lib/scheduler/defer.rb:79 run> terminated with exception (report_on_exception is true):
/usr/local/rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:323:inconnection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management/rails_61_compat.rb:8:incurrent’
from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:115:incurrent_db_hostnames' from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:111:incurrent_hostname’
from lib/discourse.rb:176:inhandle_job_exception' from /home/discourse/lib/scheduler/defer.rb:102:inrescue in do_work’
from /home/discourse/lib/scheduler/defer.rb:101:indo_work' from /home/discourse/lib/scheduler/defer.rb:79:inblock (2 levels) in start_thread’
/usr/local/rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:323:inconnection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:79:inwith_connection’
from /home/discourse/lib/scheduler/defer.rb:89:indo_work' from /home/discourse/lib/scheduler/defer.rb:79:inblock (2 levels) in start_thread’