之前先裝phpmyadmin後run程式時會跑出這一大堆哩哩扣扣,然後失敗…
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-08-13 09:02:25] INFO WEBrick 1.3.1
[2015-08-13 09:02:25] INFO ruby 2.2.1 (2015-02-26) [x86_64-linux]
Exiting
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:206:in `bind': Address already in use - bind(2) for 0.0.0.0:8080 (Errno::EADDRINUSE)
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:206:in `listen'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:461:in `block in tcp_server_sockets'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:232:in `each'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:232:in `foreach'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:459:in `tcp_server_sockets'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/utils.rb:70:in `create_listeners'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:133:in `listen'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:114:in `initialize'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:45:in `initialize'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/handler/webrick.rb:32:in `new'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/handler/webrick.rb:32:in `run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:286:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from /home/ubuntu/workspace/bin/rails:8:in `require'
from /home/ubuntu/workspace/bin/rails:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `load'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in `call'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/client/command.rb:7:in `call'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/client.rb:26:in `run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/bin/spring:48:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `load'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/ubuntu/workspace/bin/spring:13:in `require'
from /home/ubuntu/workspace/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
google了好久,終於在一個網站上發現解決之道(話說這個網站真的很好用,每次遇到問題幾乎都是在這個網站上找到解答滴)
http://stackoverflow.com/questions/26663967/rails-tutorial-chapter-1-rails-server-isnt-working-on-cloud9 原始網頁
下指令
lsof -i:8080
出現
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apache2 15456 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
apache2 15462 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
apache2 15463 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
apache2 15464 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
apache2 15465 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
apache2 15466 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
apache2 17350 ubuntu 4u IPv6 743515391 0t0 TCP *:http-alt (LISTEN)
原來是apach佔了8080port啊啊啊啊啊啊...所以停止它!
sudo /etc/init.d/apache2 stop
終於跑出頁面來了,可喜可賀~可喜可賀!
這問題搞了我一天,眼睛太用力的盯著螢幕,不酥湖,休息準備下班企…