0
我使用Rails 2.3.3和Redis gem v = 2.2.2。我有一個奇怪的問題,Rails拋出一個錯誤,說它無法要求redis gem(沒有這樣的文件加載 - redis丟失源文件),但我可以在rails控制檯(在同一臺服務器上)使用redis。無法從Rails要求redis,但在控制檯上工作
我創造,這是否
require 'redis' # throws error here
REDIS_API = Redis.new(:host => '127.0.0.1', :port => '6379', :password => 'xxxxxx')
put REDIS_API.inspect
也能正常工作在控制檯上,並在本地服務器(OS X)和我的臨時服務器(Ubuntu的),但未按規定「redis的」生產(初始值設定項Ubuntu)
我的gemlist也顯示了寶石。
*** LOCAL GEMS ***
actionmailer (2.3.3)
actionpack (2.3.3)
activerecord (2.3.3)
activeresource (2.3.3)
activesupport (3.1.3, 2.3.3)
bundler (1.0.21)
chronic (0.6.6)
daemon_controller (0.2.6)
daemons (1.1.5)
eventfulapi (2.2.1)
fastthread (1.0.7)
geokit (1.6.0)
geokit-rails (1.1.4)
highline (1.6.9)
i18n (0.6.0)
mime-types (1.17.2)
multi_json (1.0.4)
mysql2 (0.3.11)
nokogiri (1.5.0)
passenger (3.0.11)
pg (0.12.0)
rack (1.0.1)
rails (2.3.3)
rake (0.9.2.2)
rake-compiler (0.7.9)
redis (2.2.2)
right_aws (3.0.0)
right_http_connection (1.3.0)
rspec (1.2.8)
rubygems-update (1.5.3)
whenever (0.7.2)
我在使用rvm和Ruby-1.8.7-p352。任何想法我可能會錯過。我目前完全無能爲力。
是的,我已經添加了這個。 – Sid 2012-02-25 03:45:56
請在這裏添加堆棧跟蹤並試試這個「config.gem'redis',:path =>'gem_path'」。 – Jak 2012-02-25 06:33:04