Tag: apache

有些问题在生产模式下访问资产文件

我正在使用Ruby on Rails 4.1.1,在我的本地机器上,我有以下图像: # Directory: MyApp/app/assets/images/ logo.png 我使用Capistranogem上传MyApp,所有内容似乎都按预期工作。 但是当我尝试通过以下url的浏览器访问我的网站时 1) http://www.myapp.org/logo.png 2) http://www.myapp.org/assets/logo.png 3) http://www.myapp.org/images/logo.png 4) http://www.myapp.org/assets/images/logo.png 然后我得到一个错误页面: The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. 在日志文件中,我得到: 1) ActionController::RoutingError (No route matches [GET] “/logo.png”): 2) ActionController::RoutingError (No route matches [GET] “/assets/logo.png”): 3) […]

从模型中使用路径助手时,RackEnv不受尊重

在Passenger for Apache上运行Rails 3.2.13。 我的vhost: ServerName server DocumentRoot /srv/http Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all RackEnv test RackBaseURI /rails_app Options -MultiViews 效果很好。 唯一的问题是我在模型中使用路由url助手,如下所示: # egg.rb def to_exhibit return { :edit_path => Rails.application.routes.url_helpers.edit_egg_path(self) } end 在视图中呈现URL时,子URI将按照我的预期使用,但是当从模型中访问URL帮助程序时,它将被丢弃,路径始终相对于根。 来自eggs_controller.rb: edit_egg_path(1000) –> /rails_app/eggs/1000/edit 来自some_model.rb: edit_egg_path(1000) –> /eggs/1000/edit 这应该像我期望的那样工作吗? 我根本不介意手动修复它,但我很难找到RackBaseURI的值,所以我可以手动插入它,如果它存在的话。 我不想在某些环境中再次手动定义它,因为Rails必须已经知道它。

CentOS ***错误:Phusion Passenger似乎没有运行

当我通过capistrano将我的rails应用程序部署到我的CentOS服务器时,我一直收到这个错误: ***错误:Phusion Passenger似乎没有运行。 如果您确定它正在运行,那么此问题的原因可能是以下之一: 您使用Apache的PassengerInstanceRegistryDir选项,Nginx的passenger_instance_registry_dir选项或Phusion Passenger Standalone的–instance-registry-dir命令行参数自定义了实例注册表目录。 如果是,请将环境变量PASSENGER_INSTANCE_REGISTRY_DIR设置为该目录并再次运行此命令。 实例目录已被操作系统后台服务删除。 请使用Apache的PassengerInstanceRegistryDir选项,Nginx的passenger_instance_registry_dir选项或Phusion Passenger Standalone的–instance-registry-dir命令行参数设置不同的实例注册表目录。 在我的服务器上我有apache和乘客5.0.30首先,我在堆栈上查看其他答案: 链接到其中一个主题 。 遗憾的是没有什么能帮助我。 我试图从apache conf设置env路径和其他设置。 知道我应该更改什么才能部署我的rails应用程序? PATH中第一个乘客身份的完整路径在哪里? 它与passenger_root匹配吗? 以下是我的日志: $ passenger-config validate-install > What would you like to validate? Use to select. If the menu > doesn’t display correctly, press ‘!’ > > ⬢ Passenger itself ‣ ⬢ Apache > > ————————————————————————- […]

Rails应用程序不适用于apache2和乘客

使用apache2无法使我的rails 2.3.5应用程序正常工作。 在apache错误日志中,我得到以下内容: /usr/lib/phusion_passenger/passenger-spawn-server:53:in `require’: no such file to load — phusion_passenger/utils (LoadError) from /usr/lib/phusion_passenger/passenger-spawn-server:53 [ pid=9437 file=ext/apache2/Hooks.cpp:727 time=2012-04-02 20:04:49.923 ]: Unexpected error in mod_passenger: Cannot spawn application ‘/home/user/projects/pname/trunk’: The spawn server has exited unexpectedly. Backtrace: (empty) 我试图重新安装乘客,阿帕奇,但这没有帮助。 我该怎么做才能启动应用程序? 我怎样才能让精神乘客上class?