Can't create a server for RoR Tutorial?

rails
ruby

#1

Hey all! Running all of this on one of the computers in the university library.

I’ve tried three separate ways of running this, and none of them seem to be working.

I run the following code:

$ rails s -p $8080 -b $0.0.0.0

and i receive the following:

$ rails s -p $8080 -b $0.0.0.0 /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/server.rb:12:inparse!’: invalid argument: -p 080 (OptionParser::InvalidArgument)
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:315:in parse_options' from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:190:inoptions’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/server.rb:71:in set_environment' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/server.rb:55:ininitialize’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in new' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:inserver’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command!' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in<top (required)>'
from /home/ubuntu/workspace/hello_app/bin/rails:9:in require' from /home/ubuntu/workspace/hello_app/bin/rails:9:in<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in load' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:incall’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in call' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:inrun’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/bin/spring:49:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:inload’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in <top (required)>' from /home/ubuntu/workspace/hello_app/bin/spring:13:inrequire’
from /home/ubuntu/workspace/hello_app/bin/spring:13:in <top (required)>' from bin/rails:3:inload’
from bin/rails:3:in <main>'

I run this:

$ rails s -p $3000 -b $

and receive

/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:680:inbind’: Cannot assign requested address - bind(2) for 29.120.84.130 (Errno::EADDRNOTAVAIL)
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:680:in block in ip_sockets_port0' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:668:ineach’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:668:in ip_sockets_port0' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:701:intcp_server_sockets_port0’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:752:in tcp_server_sockets' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/utils.rb:65:increate_listeners’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:134:in listen' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:115:ininitialize’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:47:in initialize' from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:innew’
from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in run' from /usr/local/rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:286:instart’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in start' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:inblock in server’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in tap' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:inserver’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command!' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in<top (required)>'
from /home/ubuntu/workspace/hello_app/bin/rails:9:in require' from /home/ubuntu/workspace/hello_app/bin/rails:9:in<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in load' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:incall’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in call' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:inrun’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/bin/spring:49:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:inload’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in <top (required)>' from /home/ubuntu/workspace/hello_app/bin/spring:13:inrequire’
from /home/ubuntu/workspace/hello_app/bin/spring:13:in <top (required)>' from bin/rails:3:inload’
from bin/rails:3:in <main>'


What am I doing wrong here?


#2

syntax error.
rails s -p 8080 -b 0.0.0.0 is good enough

for your information, you can type
echo $IP
echo $PORT
to check which is the dynamical IP and Port assigned by c9