错误postgreSQL - ubuntu" rake db:migrate"

时间:2016-10-19 14:50:49

标签: ruby-on-rails database ruby-on-rails-5

我是一个新的rails。我试图设置rake db:migrate db:seedbundle exec db:migrate db seed,但它不适合我。你们可以帮帮我吗?

  postgres @DungXinhDep:/ home / ducdung / ruby​​-lab-2-hanoi-vinh $ rake db:migrate       耙子流产了!       Errno :: EACCES:权限被拒绝@ rb_sysopen - / home / ducdung / ruby​​-lab-2-   河内-荣/分贝/ 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&#39;       任务:TOP =&gt; DB:模式:转储       (通过使用--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:警告:PATH中的不可靠世界可写dir /var/lib/gems/2.3.0,模式040777       耙子流产了!       不知道如何建立任务&#db; mmigrate&#39; (见--tasks)       /var/lib/gems/2.3.0/gems/rake-11.3.0/exe/rake:27:in`'       (通过使用--trace运行任务查看完整跟踪)

1 个答案:

答案 0 :(得分:0)

您无权写入相关目录。使用chmod授予您当前帐户写入该目录的权限。

在控制台中,输入help chmod以获取进一步说明。

当您将最后一组权限(对应于&#34;其他&#34;或&#34;世界&#34;)更改为Insecure world writable dir时,会发生

777。您会看到一条警告,表示您完全允许任何人阅读,编写和执行该目录。您通常应该只允许&#34;组&#34;的读取权限。和&#34;其他&#34;权限。

要删除写入权限,例如,请运行:

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