我正在尝试将Rails3应用程序部署到windows计算机上(是的,它必须是windows,我不能使用linux)
我决定尝试使用Mongrel + Apache (如果有人知道可以工作的,我愿意尝试其他设置)。
我已经安装了mongrel,我可以运行rails server mongrel,并且可以很好地运行我的应用程序。但是,当我尝试将mongrel作为windows服务启动时
mongrel_rails service::install -N mongrel1 -e production -p 3001 -c mydirectory`我遇到了麻烦。服务器启动正常,但当我试图访问网页时,在我的mongrel.log文件中出现以下错误。
Error calling Dispatcher.dispatch #<NameError: uninitialized constant ActionController::CgiRequest>
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:76:in `block in process'
<internal:prelude>:10:in `synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:74:in `process'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:165:in `block in process_client'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:164:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:164:in `process_client'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.rb:291:in `block (2 levels) in run'我试着阅读了这一点,但所有的设置指南似乎都很过时。
发布于 2012-05-17 21:46:17
我正在使用Apache + Mongrel在Windows (Win7)上运行一个Rails3应用程序。这里可能是另一种方法。在httpd.conf中,我将DocumentRoot设置为我的rails应用程序的路径。然后,将Directory标记设置为任意Document Root。然后添加一个VirtualHost标签,如下所示:
<VirtualHost localhost:80>
Servername YourAppServer
DocumentRoot "same path as before"
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost On
</VirtualHost>"我认为ServerName的值是任意的。
您还需要添加: LoadModule代理模块/mod_proxy.so LoadModule代理模块/mod_ proxy_module _http.so
我认为,如果您使用端口3001而不是3000,请进行适当的替换。
然后用'rails server -e production Apache3001‘启动一切(从你的应用程序文件夹)( -p应该已经在运行了)
https://stackoverflow.com/questions/10616026
复制相似问题