今天我到处都在寻找为旅客正确设置RAILS_ENV的方法.现在该站点位于我的服务器上,因此我想使用测试环境,但是我不希望它成为生产环境,因为我遇到了数据库问题.
I've been everywhere today looking for the way to properly set my RAILS_ENV for Passenger. I want to use the test environment now that the site is on my server, but I don't want it to be production because I'm having database issues.
我被定向到文档的这一部分,但对我来说没有任何意义.我在该站点的Apache .conf文件中有 PassengerAppEnv RAILS_ENV ='test',并且-如预期的那样-无效.
I've been directed to this part of the documentation, but it didn't make any sense to me. I had PassengerAppEnv RAILS_ENV = 'test' in my Apache .conf file for the site and -- as expected -- that didn't' work.
我还在我的Rails站点的 config/environment.rb 中设置了 RAILS_ENV ='test',但这也不起作用.
I've also set RAILS_ENV = 'test' in config/environment.rb of my Rails site, but that didn't work either.
谢谢!
推荐答案您已经接近,但不太正确.设置方法如下:
You're close, but not quite correct. Here is how you set it:
<Directory /path/to/app/public> Allow from all Options -Multiviews # ^ for Apache 2.4+ Require all granted RailsEnv development # < place desired environment here </Directory>基本上,Passenger将在配置文件中看到该行,然后为您设置.它使用更多的Apache样式语法:
Basically Passenger will see the line in the configuration file and then set it for you. It uses the more Apache style syntax of:
Name [space] <value>因此,您根本不需要所有的引号或任何Ruby样式的语法.
So you don't need all the quotes or any Ruby style syntax at all.
更多推荐
我如何用Passenger和Apache设置RAILS
发布评论