Rails 5服务器切换到默认端口而不是指定端口

时间:2017-01-30 20:33:00

标签: ruby-on-rails macos

我刚刚设置了一台新Mac(macOS 10.12.3)。我已经安装了RVM,Homebrew等。到目前为止,唯一安装的Ruby是2.4.0,Rails是5.0.1。 rails命令是:

$ rails new food_lookup --api

当运行Rails服务器进行开发工作时,我指定端口3001,但由于某种原因,服务器决定它想要侦听端口3000. Listening on tcp://0.0.0.0:3000

$ rails server --port=3001
/Users/me/.rvm/gems/ruby-2.4.0@food_lookup/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/Users/me/.rvm/gems/ruby-2.4.0@food_lookup/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://localhost:3001
=> Run `rails server -h` for more startup options
/Users/me/.rvm/gems/ruby-2.4.0@food_lookup/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
Puma starting in single mode...
* Version 3.7.0 (ruby 2.4.0-p0), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

此时我的日志是空的。

有没有人见过这个?它在我以前的Mac OS X 10.11上完美运行。我有相同版本的Rails,Ruby等,但也许我忘了在这台新机器上安装一些东西?

1 个答案:

答案 0 :(得分:0)

显然这是本周发布的Puma 3.7.0的一个问题。

https://github.com/puma/puma/issues/1200