启动rails服务器时奇怪的“没有这样的文件加载 - redis-namespace”异常

时间:2010-07-12 08:37:38

标签: ruby-on-rails redis

我正在使用Rails 2.3.8 + redis + resque + redis-namespace

这是我environment.rb

的一部分
  config.gem 'jrails'
  config.gem 'haml'
  config.gem 'redis'
  config.gem 'redis-namespace'
  config.gem 'resque

这是我的gem list

redis (2.0.3)
redis-namespace (0.7.0)
resque (1.9.7)

当我通过'script / server'启动我的服务器时,它显示了这样的异常:

=> Rails 2.3.8 application starting on http://0.0.0.0:3000
no such file to load -- redis-namespace
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:164:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
/mnt/workspace/webtails/config/environment.rb:9

我已多次重新安装redis-namespace,并且始终显示此错误消息。哪里错了?

1 个答案:

答案 0 :(得分:1)

因为此文件不存在。您需要'redis / namespace'

config.gem 'redis-namespace', :lib => 'redis/namespace'