チュートリアルの3章を勉強中なのですが(http://railstutorial.jp/chapters/static_pages?version=4.2#sec-generated_static_pages)
リスト3-4で
$ rails generate controller StaticPages home help
このコマンドをしてから$ rails server -b $IP -p $PORTを入力すると
=> Booting WEBrick
=> Rails 4.2.4 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-11-11 09:39:15] INFO WEBrick 1.3.1
[2015-11-11 09:39:15] 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.4/lib/rack/handler/webrick.rb:31:in `new'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in `run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/server.rb:80:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from /home/ubuntu/workspace/sample_app/bin/rails:8:in `require'
from /home/ubuntu/workspace/sample_app/bin/rails:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /usr/local/rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/ubuntu/workspace/sample_app/bin/spring:13:in `require'
from /home/ubuntu/workspace/sample_app/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
となってしまいますがこれってエラーですよね?
ビューも開けないのですが、どなたか教えていただきたいです
もしかしたら上のコマンド関係ないのかもしれないです。
よろしくお願いします。
bin/rails の3行目で読み込んでいるのは何ですか?
/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)
これを見ると0.0.0.0:8080が既に使われていると出ていますね。
設定ファイルを見直す必要がありそうですね
お礼
おそらく、違うアプリの方が停止できていなかったのだと思います。 ありがとうございます。 翌日になり、再度クラウド9にログインしたところ普通にサーバーが立ち上がりました。 難しいです(*_*)