开发者

rails running in staging on production machine

I have a machine where all my rails apps are running in a "staging" environment, even the production ones. It is trying to connect to the staging database. I have tried setting it set to production in the following places:

#/etc/apache2/mods-enabled/passenger.so: 
# the line above was wrong, it is in /etc/apache2/sites-enabled/ier

RailsBaseURI /ier
RailsEnv production
<Directory /rails/production/ier/current/public>
  Options -MultiViews
</Directory>

#app/controllers/application_controller.rb
Rails.env = 'production'

I even tried putting it in:

#config/environment.rb adding Rails.env = 'production'

I am getting a passenger error of:

staging database is not configured (ActiveRecord::AdapterNotSpecified)

I even ran ( grep -R "staging" . in ) and got:

Binary file ./.git/index matches
./config/deploy.rb:set :stages, %w(staging production)
./config/deploy.rb:#    %w{staging.rb}.each do |config|
./config/deploy.rb:#    %w{production.rb staging.rb}.each do |deploy_env|
./config/database.yml:staging:
grep: ./config/deploy/staging.rb: No such file or directory
grep: ./conf开发者_StackOverflowig/deploy/production.rb: No such file or directory

I am running Apache2, Passenger 3.0.7, ruby 1.9.2, and rails 3.0.9

Where else can I look to find out where I set the environment to staging?

thanks for any help


Try putting this inside your <VirtualHost> configuration (probably in /etc/apache2/site-enabled/000-default).

RailsEnv production
RackEnv production

I hear some versions of Passenger required RackEnv instead of RailsEnv so you might want to try that especially.

You can also try putting it in an .htaccess file in your public directory if you have AllowOverride set to Options or All.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜