0

我按照这个指南https://devcenter.heroku.com/articles/rails4-getting-started创建了 rails 应用程序。但是当我运行Heroku run rake db:migrate命令返回错误时:Error: Permission denied - connect(2) (Errno::EACCES)

更新的 迁移

class CreatePosts < ActiveRecord::Migration
  def change
    create_table :posts do |t|
      t.string :tilte
      t.timestamps
    end
  end
end

UPDTE 2 Heroku 配置

=== powerful-eyrie-5396 Config Vars                                                                                                                                                               
DATABASE_URL:                 postgres://bqfsdarajfpdlk:4nU5FON87juyFwSdaX7Sr3Aicl@ec2-54-225-89-245.compute-1.amazonaws.com:5432/d65593ob81m9g8                                                  
HEROKU_POSTGRESQL_COBALT_URL: postgres://bqfsdarajfpdlk:4nU5FON87juyFwSdaX7Sr3Aicl@ec2-54-225-89-245.compute-1.amazonaws.com:5432/d65593ob81m9g8

更新 3 heroku 命令回溯

Error:       Permission denied - connect(2) (Errno::EACCES)                                                                                                           
Backtrace:   /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/client/rendezvous.rb:40:in `initialize'           
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/client/rendezvous.rb:40:in `open'                 
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/client/rendezvous.rb:40:in `block in start'       
             /opt/rh/ruby193/root/usr/share/ruby/timeout.rb:69:in `timeout'                                                                                           
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/client/rendezvous.rb:31:in `start'                
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/command/run.rb:132:in `rendezvous_session'        
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/command/run.rb:119:in `run_attached'              
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/command/run.rb:24:in `index'                      
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/command.rb:206:in `run'                           
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/lib/heroku/cli.rb:28:in `start'                              
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/gems/heroku-2.39.4/bin/heroku:17:in `<top (required)>'                          
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/bin/heroku:23:in `load'                                                         
             /var/lib/stickshift/51bef7595973caa43f000531/app-root/data/lib/ruby/gems/bin/heroku:23:in `<main>'
4

2 回答 2

1

这个问题解决了这个命令:

heroku run:detached rake db:migrate
于 2013-06-24T05:48:04.527 回答
0

尝试先重置数据库

heroku pg:reset DATABASE

然后

heroku run rake db:migrate
于 2013-06-21T14:40:37.280 回答