【问题标题】:Rails 5 server switches to default port instead of specified portRails 5 服务器切换到默认端口而不是指定端口
【发布时间】:2017-01-30 20:32:59
【问题描述】:

我只是设置了一台新的 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

此时我的日志是空的。

有人看过吗?它在我以前使用 OS X 10.11 的 Mac 上运行良好。我有相同版本的 Rails、Ruby 等,但也许我忘了在这台新机器上安装一些东西?

【问题讨论】:

    标签: ruby-on-rails macos


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2016-09-06
      • 2022-12-16
      • 2019-11-15
      • 2015-02-10
      • 2016-05-02
      • 2014-07-01
      • 2016-05-26
      • 2019-03-30
      • 1970-01-01
      相关资源
      最近更新 更多