Michel Tran
Michel Tran

Reputation: 1

error postgreSQL - ubuntu "rake db:migrate"

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)

Upvotes: 0

Views: 775

Answers (1)

MarsAtomic
MarsAtomic

Reputation: 10696

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

Upvotes: 0

Related Questions