【问题标题】:Running Rails Server in a UNIX socket在 UNIX 套接字中运行 Rails 服务器
【发布时间】:2012-12-22 17:29:28
【问题描述】:

是否可以在 UNIX 套接字中运行 rails server

我问是因为rails server 提供了如此漂亮的输出,并且很容易区分 SQL 查询和 HTTP 请求等。但是,我使用的是 Nginx,所以我想使用它来连接应用程序服务器UNIX 套接字,但我遇到了一些问题。

以下命令导致错误:

bundle exec rails server thin --socket=/var/run/rails_app.sock

它似乎试图将--socket 解析为rails server 上的一个选项,而不是thin。有什么办法可以解决这个问题,还是我坚持使用thin start 并屈服于不太漂亮的日志输出?

【问题讨论】:

  • 你的意思是,在开发中还是在生产中?

标签: ruby-on-rails ruby nginx thin


【解决方案1】:

尝试使用:

bundle exec rails server thin -- --socket=/var/run/rails_app.sock

-- 用于在许多 *nix 应用程序上标记第一个命令的参数结束。

来自man sh

   --        A  --  signals the end of options and disables further option processing.  Any arguments after the --
             are treated as filenames and arguments.  An argument of - is equivalent to --.

【讨论】:

  • 那行不通。 -- 停止 bundle exec 的参数,rails server thin 是其中的一部分。
猜你喜欢
  • 1970-01-01
  • 2013-08-18
  • 2015-06-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-02-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多