Errno::EACCES: Permission denied on new Ubuntu development setup

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?

1 Like

Yes, it’s solved! Small things can make a big difference!

1 Like

For this there is now a new mistake (unbelievable :roll_eyes:!):

#<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- connection_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:in current’
from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:115:in current_db_hostnames' from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:111:in current_hostname’
from lib/discourse.rb:176:in handle_job_exception' from /home/discourse/lib/scheduler/defer.rb:102:in rescue in do_work’
from /home/discourse/lib/scheduler/defer.rb:101:in do_work' from /home/discourse/lib/scheduler/defer.rb:79:in block (2 levels) in start_thread’
/usr/local/rvm/gems/ruby-3.0.2/gems/activerecord- connection_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:in with_connection’
from /home/discourse/lib/scheduler/defer.rb:89:in do_work' from /home/discourse/lib/scheduler/defer.rb:79:in block (2 levels) in start_thread’