【问题标题】:Apache: Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in the server configurationApache:无效命令“RailsEnv”,可能拼写错误或由服务器配置中未包含的模块定义
【发布时间】:2013-08-24 02:31:56
【问题描述】:

我正在使用 Rails 3 + Apache + Passenger,并且正在尝试部署到新服务器。我不太熟悉 RailsEnv 的来源,并且在检查我的 apache 配置的语法时遇到此错误。

Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in the server configuration

有人知道RailsEnv 来自哪个模块吗?

【问题讨论】:

  • 您是否启用了乘客模块,即在 Apache 中?
  • 不,我不这么认为。我该怎么做?

标签: ruby-on-rails apache passenger


【解决方案1】:

安装 Apache 乘客模块,遵循此处针对您的特定环境的指南:http://blog.phusion.nl/2011/03/02/phusion-passenger-3-0-4-released/

然后,使用以下命令启用模块:

sudo a2enmod passenger

最后重启apache。

【讨论】:

  • 我收到ERROR: Module passenger does not exist!
  • 试试安装乘客apt-get install libapache2-mod-passenger
【解决方案2】:

对我来说,这是因为我将一个 linux 服务器配置复制到我的 mac 安装中:

<IfModule mod_passenger.c>
  LoadModule passenger_module .../mod_passenger.so
  PassengerRoot .../locations.ini
  PassengerDefaultRuby .../ruby
</IfModule>

删除&lt;IfModule&gt; 标签为我修复了它。我猜 mod_passenger.c 在 mac 上不存在,所以乘客模块根本不会加载。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-04
    • 2012-04-26
    • 2018-02-12
    • 2015-05-14
    • 1970-01-01
    • 2016-04-24
    • 2013-09-21
    相关资源
    最近更新 更多