2016-06-30 31 views
0

我開始對CLOUD9我開發服務器時,目前出現此錯誤:獲取EADDRINUSE錯誤的CLOUD9開始PUMA當IDE

`trimakas:~/workspace (master) $ rails s -p $PORT -b $IP 
=> Booting Puma 
=> Rails 4.2.3 application starting in development on http://0.0.0.0:8080 
=> Run `rails server -h` for more startup options 
=> Ctrl-C to shutdown server 
[39230] Puma starting in cluster mode... 
[39230] * Version 3.4.0 (ruby 2.3.0-p0), codename: Owl Bowl Brawl 
[39230] * Min threads: 5, max threads: 5 
[39230] * Environment: development 
[39230] * Process workers: 2 
[39230] * Preloading application 
[39230] * Listening on tcp://0.0.0.0:8080 
Exiting 
/usr/local/rvm/gems/ruby-2.3.0/gems/puma-3.4.0/lib/puma/binder.rb:255:in 
`initialize': Address already in use - bind(2) 
for "0.0.0.0" port 8080 (Errno::EADDRINUSE)` 

然後我試圖找到爲什麼它與使用: lsof -wni tcp:8080

但什麼都沒有發現??!

然後我嘗試用絕對沒有運氣以下:

puma -C config/puma.rb

rails server -b http://0.0.0.0:8080

rails s -b 0.0.0.0 -p 8080

rails s -p $PORT -b $IP

puma.config文件很簡單,看起來像這樣:

environment 'development' 

workers Integer(ENV['WEB_CONCURRENCY'] || 2) 
threads_count = Integer(ENV['MAX_THREADS'] || 5) 
threads threads_count, threads_count 

preload_app! 

rackup  DefaultRackup 
port  8080 
environment 'development' 

daemonize true 

on_worker_boot do 
    ActiveSupport.on_load(:active_record) do 
    ActiveRecord::Base.establish_connection 
end 
end 

感謝 託德

+0

任何人有任何想法? – ToddT

回答

1

有完全相同的問題。
已經給出解決方案here

你必須殺死所有紅寶石進程:

killall ruby 

之後,只需重新啓動服務器

rails server -b $IP -p $PORT 

希望它可以幫助,如果你還沒有找到解決辦法。

+1

雖然這個鏈接可能回答這個問題,但最好在這裏包含答案的重要部分,並提供參考鏈接。如果鏈接頁面更改,則僅鏈接答案可能會失效。 - [來自評論](/ review/low-quality-posts/13181310) – Everettss

+0

謝謝!將遵循這些建議。 – ery