2012-08-23 86 views
0

运行,即使当我启动我的应用程序在生产中推出到服务器之前对其进行测试写入开发数据库,​​我注意到,这是由Resque叫我的数据库操作之一。 enqueue(worker)在WRONG数据库上执行! development.sqlite3而不是production.sqlite3。我使用零配置文件运行服务器和resque。必须有一些方法在正确的环境中运行redis或resque。Resque从服务器在生产模式

defaults: &defaults 
host: localhost 
port: 6379 
development: 
<<: *defaults 
test: 
<<: *defaults 
staging: 
<<: *defaults 
production: 
<<: *defaults 

这redis的配置文件,我发现可以把握关键,但Redis的不喜欢,说

*** FATAL CONFIG FILE ERROR *** 
Reading the configuration file, at line 1 
>>> 'defaults: &defaults' 
Bad directive or wrong number of arguments 
+0

我填写在配置文件中按我在这里看到http://stackoverflow.com/questions/6075874/need-help-configuring-a-redis-backed-library -on-ruby-on-rails-with-rvm – light24bulbs

回答

4

什么时候开始在生产环境中resque工人?你可以像这样做,

 
$ RAILS_ENV=production QUEUE=* rake resque:work 
+1

这是关键。我也推出 'RAILS_ENV =生产resque-web配置/初始化/ resque.rb' 或事情似乎没有工作。谢谢! – light24bulbs