使用Apache和Passenger将Ruby部署到生产环境

问题描述

背景: 我的网络应用程序在unbuntu 18.04 + Apache&Passenger上运行。我正在使用ruby 2.5和rails 5.2。现在,该项目正在开发环境中运行。

不确定是否需要更多信息,请询问。感谢任何可以提供帮助的人。我正在考虑改用Nginx并使用红宝石宝石盖。

问题: 我正在尝试配置乘客以在Production中运行我的rails应用程序,但是我只能使其在开发环境中运行。当我尝试为生产环境进行更改时,它只是停止工作...

更改后我正在运行

   sudo apache2ctl restart
   sudo service apache2 restart 

我的.conf文件

<VirtualHost *:80>
 ServerName dev1.example.net
 #ServerAlias dev1.example.net
 #ServerAdmin webmaster@localhost
 DocumentRoot /home/augustus/dev/xxx/public
 RailsEnv development
 PassengerRuby /home/augustus/.rbenv/versions/2.5.0/bin/ruby
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
 <Directory /home/augustus/dev/xxx/public >
     # Allow from all
     AllowOverride all
     Options -MultiViews
     # Options FollowSymLinks
     Require all granted
</Directory>

:我尝试过的 我将RailEnv设置为“生产” 我也已经完全重新安装了仓库 我阅读了其他有关此内容的堆栈溢出文章。我没有问题让它运行,而只是将其投入生产。当我访问网页(www.example.com)时,它给我的提示是“很抱歉,但是出了点问题”。

最有用的链接

OS X: Development & Production Deployment for RoR with Apache and Passenger

&&乘客dox

https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/digital_ocean/apache/oss/bionic/deploy_app.html

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)