0
votes

I'm a new rails.I tried to set up rake db:migrate db:seed and bundle exec db:migrate db seed but it's not working for me.Can u guys help me?please.

postgres@DungXinhDep:/home/ducdung/ruby-lab-2-hanoi-vinh$ rake db:migrate rake aborted! Errno::EACCES: Permission denied @ rb_sysopen - /home/ducdung/ruby-lab-2- hanoi-vinh/db/schema.rb /var/lib/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:252:in initialize /var/lib/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:252:in open /var/lib/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:252:in block (3 levels) in <top (required)> /var/lib/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:66:in block (2 levels) in <top (required)> /var/lib/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/railties/databases.rake:59:in block (2 levels) in <top (required)> /var/lib/gems/2.3.0/gems/rake-11.3.0/exe/rake:27:in' Tasks: TOP => db:schema:dump (See full trace by running task with --trace)

postgres@DungXinhDep:/home/ducdung/ruby-lab-2-hanoi-vinh$ bundle exec rake db:mmigrate /usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /var/lib/gems/2.3.0 in PATH, mode 040777 rake aborted! Don't know how to build task 'db:mmigrate' (see --tasks) /var/lib/gems/2.3.0/gems/rake-11.3.0/exe/rake:27:in `' (See full trace by running task with --trace)

1
Please don't post images of text. You can simply copy the text itself from the console and paste it into your original question. Please edit your question to include the text.MarsAtomic
Permission denied means you're not using the correct keys for access...bkunzi01
@MarsAtomic ya.i'm sorry.it's the first time i post question here :) thank your commentMichel Tran
@bkunzi01 i don't know what you meanMichel Tran
if you type "psql" on your command line does it allow you access? It could be that the default user wasn't setup and that you're trying to log into postgres with a username that has no account.bkunzi01

1 Answers

0
votes

You don't have permissions to write to the directory in question. Use chmod to give your current account permissions to write to that directory.

In the console, type help chmod for further instructions.

Insecure world writable dir occurs when you change the last set of permissions (corresponding to "other" or "world") to 777. You're seeing a warning that you're allowing absolutely anyone at all to read, write and execute that directory. You should typically only be allowing read permissions for the "group" and "other" permissions.

To remove write permissions, for example, run:

chmod go -w /home/ducdung/ruby-lab-2-hanoi-vinh