rails 3.2.10
乘客 3.0.19
Ruby 1.9.3-p392(使用 rbenv)
尝试通过 Passenger 在我的服务器上运行我的 Rails 应用程序。收到此错误:
No such file to load -- path_to_app/app/assets/stylesheets/../config/environment
这是我的 Apache 配置文件:
<VirtualHost *:80>
ServerName domain.com
DocumentRoot /srv/http
<Directory /srv/http>
Allow from all
</Directory>
RackBaseURI /rails_app
RackEnv test
<Directory /srv/http/rails_app>
Options -MultiViews
</Directory>
</VirtualHost>
(其中/srv/http/rails_app --> path_to_app/public)
我真的不知道它为什么要在 Assets 目录中寻找配置文件。这是 config.ru(据我所知,这是库存):
require ::File.expand_path('../config/environment', __FILE__)
run RailsApp::Application
我以前做过,但仅限于 Rails 2.x。我做错了什么吗?
更新:即使尝试从命令行启动测试或生产服务器时也会发生这种情况,因此它不是乘客。一个新的 Rails 应用程序在所有环境中都能正常工作,所以它一定是迁移或 gem 问题,但我什至不知道从哪里开始。
最佳答案
原来在 app/assets/stylesheets 中有一些奇怪的 FCGI 文件(dispatch.rb, dispatch.fcgi)。一定是在它还是 Rails 2.x 应用程序时遗留下来的,或者是被意外移动到那里的。
关于ruby-on-rails - Rails 3 乘客路径错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15981416/