rails resque-web gem版本与捆绑的gem版本不同步,如何告诉resque-web使用正确的gem版本?

时间:2012-12-12 03:34:23

标签: ruby-on-rails resque

如何告诉resque-web使用正确的机架,sinatra和拉斯维加斯的宝石版本? 当我访问resque-web

时,我正在尝试解决未定义的方法`process_route错误

如果我运行捆绑,我会

Using rack (1.4.1) 
Using sinatra (1.3.3) 
Using vegas (0.1.11) 
Using resque (1.23.0) 
Using rufus-scheduler (2.0.17) 
Using resque-scheduler (2.0.0) from https://github.com/bvandenbos/resque-scheduler.git (at master) 

这是resque-web应该使用的宝石的正确版本,但是当我运行resque-web -v时,我得到了

rack 1.1
sinatra 1.0
vegas 0.1.8

这让我感到非常头疼(假设这是原因)

undefined method `process_route' for #<Resque::Server:0xbc22f94>

当我尝试在浏览器中访问resque web时

如果我跑

bundle exec resque-web -v

我得到了

rack 1.1
sinatra 1.3.3
vegas 0.1.11

哪个机架版本仍然是错误的。

我正在使用以下路线安装resque服务器

mount Resque::Server, :at => "/resque", :constraints => AdminRestriction

我在使用ruby 1.9.3和rvm的rails 3.2.9应用程序中运行nginx,unicorn设置来管理项目特定的gemsets

这是生产服务器唯一的问题,我的开发PC上的一切都很好

1 个答案:

答案 0 :(得分:1)

看起来您在系统中安装了resque-web gem,但不在您的捆绑包中。这导致它加载不兼容的版本,即使您运行bundle exec

您应该可以通过将resque-web添加到Gemfile

来解决此问题
gem "resque-web"

bundle exec命令将首先查看二进制文件/脚本的包,然后执行捆绑版本。但是,如果gem不在bundle中,它将回退到系统上的二进制/ bundle。