0

Unicorn 处于循环状态并显示以下错误:

独角兽错误

错误 -- : 找不到 dalli_store 的缓存存储适配器(无法加载此类文件 -- active_support/cache/dalli_store)(RuntimeError)

生产.rb

config.cache_store = :dalli_store, "127.0.0.1:11211", { :namespace => "my-app", :expires_in => 3600 }

宝石文件

gem 'dalli', '~>2.1.0', :git => "git://github.com/mperham/dalli.git"

我在 Rails 控制台中测试过,dalli 似乎没有问题。

Loading production environment (Rails 3.2.8)
irb(main):001:0> Rails.cache.write("hello", "world")
=> true
irb(main):002:0> Rails.cache.read("hello")
=> "world"

irb(main):002:0> Rails.cache
=> #<ActiveSupport::Cache::DalliStore:0xabaefc8 @options={:namespace=>"my-app", :expires_in=>3600, :compress=>nil}, @raise_errors=false, @data=#<Dalli::Client:0xabaef00 @servers=["127.0.0.1:11211"], @options={:namespace=>"my-app", :expires_in=>3600, :compress=>nil}, @ring=#<Dalli::Ring:0xa2db0e0 @servers=[#<Dalli::Server:0xa2db158 @hostname="127.0.0.1", @port=11211, @weight=1, @fail_count=0, @down_at=nil, @last_down_at=nil, @options={:down_retry_delay=>1, :socket_timeout=>0.5, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>nil, :password=>nil, :keepalive=>true, :namespace=>"my-app", :expires_in=>3600, :compress=>nil}, @sock=#<Dalli::Server::KSocket:fd 8>, @msg=nil, @pid=27069, @inprogress=false, @lock=#<Monitor:0xa2db0a4 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0xa2db07c>>, @version="1.4.2", @error=nil>], @continuum=nil, @failover=true>>>

任何帮助,将不胜感激。

4

2 回答 2

0

如果有人遇到类似的问题:我已经删除了捆绑程序下载的 Gemfile.lock 和 dalli gemspec 文件(在 /path/to/app/shared/bundler/gems/ruby/1.8/specifications/dalli.gemspec 之类的地方),运行'捆绑安装',它有帮助。

于 2013-01-14T06:43:54.157 回答
0

我有同样的问题,在我的情况下,它是由“rvm”引起的

(我的设置是 Phushion-Passenger、Rails3、Memcached)

我修复了它:

rvm all do gem install uuidtools

,

rvm all do gem install dalli

,

rvm all do gem install kgio

,

rvm all do gem bundle install

现在我的 memcached 统计数据显示:

# nc 127.0.0.1 11211

stats

STAT pid 23112
STAT uptime 53446
STAT time 1367778065
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 0.692043
STAT rusage_system 0.000000
STAT curr_connections 7
STAT total_connections 11
STAT connection_structures 8
STAT cmd_get 19
STAT cmd_set 10
STAT cmd_flush 0
STAT get_hits 5
STAT get_misses 14
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 2326
STAT bytes_written 8910
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT bytes 1377
STAT curr_items 10
STAT total_items 10
STAT evictions 0
STAT reclaimed 0
END

希望这可以帮助

于 2013-05-05T18:29:24.277 回答