socket.rb:206:在`bind':地址已经在使用 - bind(2)为127.0.0.1:3000(Errno :: EADDRINUSE)

时间:2016-12-01 04:05:15

标签: ruby-on-rails postgresql heroku

运行RAILS_ENV=production bundle exec rails s

时出现以下错误
  

`bind':地址已在使用中 - bind(2)为127.0.0.1:3000(Errno :: EADDRINUSE)

我已经尝试了其他一些帖子,从那里我找到了以下命令rails s -p 3001这适用于localhost:3001但是当我推送到heroku时,当我转到我的网址时出现以下错误。我猜测我的database.yml文件可能存在问题,因为它给了我一些问题。

  

我们很抱歉,但出了点问题。

rails -v Rails 4.2.1
ruby -v ruby​​ 2.2.0p0(2014-12-25修订版49005)[x86_64-darwin15]

的database.yml



default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  pool: 5

development:
  <<: *default
  database: vlog_development


test:
  <<: *default
  database: vlog_test


production:
  <<: *default
  database: vlog_production
  username:
  password: 
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

This is because of your default 3000 port is busy.Use command "ps" on terminal


    PID TTY          TIME CMD
     4662 pts/5    00:00:00 bash
     4975 pts/5    00:00:03 ruby
     4982 pts/5    00:00:00 ps

Then kill process by command on terminal sudo kill -9 PID. Then start your server again.
相关问题