Rails server won't run

rails

#1

Hi all, I’m a total newbie so my apologies if I don’t give the correct information straight away.

I’m having trouble with my getting my server to run so I can view my app. When I type the command

bundle exec rails s -e production -p 3010

I get the following response:
=> Booting WEBrick
=> Rails 4.2.5 application starting in production on http://localhost:3010
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
[2018-09-17 04:01:31] INFO WEBrick 1.3.1
[2018-09-17 04:01:31] INFO ruby 2.3.4 (2017-03-30) [x86_64-linux]
[2018-09-17 04:01:31] INFO WEBrick::HTTPServer#start: pid=16121 port=3010

When I click the hyperlink, the website just times out.

If I click the “run project link” the process starts running the project but within a minute provides the following output:
Exiting
/usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.10/lib/rack/handler.rb:90:in require': cannot load such file -- rack/handler/c (LoadError) from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.10/lib/rack/handler.rb:90:intry_require’
from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.10/lib/rack/handler.rb:16:in get' from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.10/lib/rack/server.rb:291:inserver’
from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:125:in print_boot_information' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:75:instart’
from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in block in server' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:intap’
from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in server' from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:inrun_command!’
from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands.rb:17:in <top (required)>' from /home/ubuntu/workspace/bin/rails:9:inrequire’
from /home/ubuntu/workspace/bin/rails:9:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload’
from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall’
from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/client.rb:30:in run' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/bin/spring:49:in<top (required)>’
from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load' from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/binstub.rb:31:in<top (required)>’
from /home/ubuntu/workspace/bin/spring:15:in require' from /home/ubuntu/workspace/bin/spring:15:in<top (required)>’
from bin/rails:3:in load' from bin/rails:3:in


#2

Try rails s -b $IP -p $PORT


#3

Newbie question: do I change the text in IP and PORT to my IP and port?


#4

You can’t change the IP but Cloud9 will allow you to use ports 8080, 8081, or 8082. 8080 is the default used in $PORT.