/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:12:in parse!': invalid argument: -p -b (OptionParser::InvalidArgument)
from /usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.8/lib/rack/server.rb:316:in
parse_options'
来自/usr/local/rvm/gems/ruby-2.3.4/gems/rack-1.6.8/lib/rack/server.rb:191:in options'
from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:71:in
set_environment'
来自/usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/server.rb:55:in initialize'
from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in
new'
来自/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:in
run_command!'
来自/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:in
要求&#39;
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:in
load&#39;
来自/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:in
来电&#39;
来自/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
&#39;
来自/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
&#39;
来自/ home / ubuntu / workspace / bin / spring:15:require'
from /home/ubuntu/workspace/bin/spring:15:in
&#39;
来自bin / rails:3:load'
from bin/rails:3:in
&#39;
答案 0 :(得分:1)
它将是server
或s
而不是-s
,如下所示
rails server -b $IP -p $PORT
或
rails s -b $IP -p $PORT
答案 1 :(得分:0)
我从另一个论坛得到了这个答案,并且它有效。我刚刚将“$ port”改为“$ PORT”。我不确定是否因为区分大小写。