【发布时间】:2016-11-19 18:42:03
【问题描述】:
我正在coolmappdb.com 的 Inmotion 主机上部署 Rails 应用程序 - 当我到达那里时,它说
Could not spawn process for application /home/username/public_html/coolmappdb.com: An error occurred while starting up the preloader.
<p>If that didn't work, then maybe the problem is that your gems are installed to <code>/home/username/.rvm/gems</code>, while at the same time you set <code>PassengerRuby</code> (Apache) or <code>passenger_ruby</code> (Nginx) to <code>/usr/local/rvm/gems/ruby-2.3.1/wrappers/ruby</code>. Because of the latter, RVM does not load gems from the home directory.</p>
错误信息很清楚。据说我的 Phusion 乘客指向了错误的位置。我怎样才能让它在正确的位置工作?
更新:
<VirtualHost 170.239.250.29:80>
ServerName coolmappdb.com
ServerAlias www.coolmappdb.com
DocumentRoot /home/coolma7/public_html
PassengerRuby /home/coolma7/.rvm/gems
ServerAdmin webmaster@coolmappdb.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/coolmappdb.com combined
<IfModule log_config_module>
<IfModule logio_module>
CustomLog /usr/local/apache/domlogs/coolmappdb.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
</IfModule>
</IfModule>
</VirtualHost>
【问题讨论】:
-
你检查过目录的权限吗?我曾经遇到过类似的问题,因为我创建了一个用户来运行我的 ruby 应用程序,但是 gem 安装在一个目录中,该目录的权限未正确设置为该用户读取。
-
是的代码在公共文件夹中
-
你使用的是 Apache 还是 Nginx ?
-
然后在您的 VirtualServer 中将
PassengerRuby设置为/home/[username]/.rvm/gems,其中 [username] 是您的用户名。 -
这显然不是您的 Apache 配置,而是您在某处获取的示例。请发布您的配置,因为问题可能出在差异上,我们永远不会看到它。
标签: ruby-on-rails apache ruby-on-rails-4 rubygems passenger