You can't use groups w/ heroku + bundler. You can do something like
"if RUBY_PLATFORM =~ /darwin/" ... but then you'll run into problems
if you have your Gemfile.lock checked in. To get around this, we just
don't check in the Gemfile.lock.
To make sure it's working locally, I'd start memcached with "memcached
-vvvv" -- that way, you'll be able to see the log directly... which is
the best way to determine whether it's your applications fault or
heroku's. You should see something like:
ree-1.8.7-2010.02 > Rails.cache.write("foo", 1)
... and in the memcached log:
<8 set foo 0 0 107
> NOT FOUND foo
>8 STORED
ree-1.8.7-2010.02 > Rails.cache.read("foo")
<8 get foo
> FOUND KEY foo
>8 sending key foo
>8 END
ree-1.8.7-2010.02 > Rails.cache.read("foo-idontexist")
=> nil
<8 get foo-idontexist
> NOT FOUND foo-idontexist
>8 END
On Oct 18, 9:40 am, Joost Schuur <[email protected]> wrote:
> I've been experimenting with memcached and read good things about the
> dalli gem, so I thought I'd try it out on Heroku. I can't seem to get
> it to work and m not getting back any obvious errors either.
>
> My production.rb defines:
>
> config.action_controller.perform_caching = true
> config.cache_store = :dalli_store
>
> ...and in my Gemfile:
>
> gem 'dalli'
>
> However, based on the logs, it's not reading from the cache. Upon
> refreshing the page in question twice (to make sure the cache was
> written the first time around), I still get this:
>
> Exist fragment? views/front_sidebar (506.9ms)
> Write fragment views/front_sidebar (508.3ms)
>
> Likewise, from the heroku console for the app in question:>>
> Rails.cache.write('hello', 'world')
> => false
> >> Rails.cache.read('hello')
>
> => nil
>
> I've restarted the heroku server during my tests too, and have
> confirmed that I have the add-on installed (the app name is
> tvgridthing-stage, if a Heroku rep would like to take a look).
>
> I don't know what other debug tools there are for dalli. I tried
> checking the stats, but the instructions
> athttp://docs.heroku.com/memcache#getting-stats-on-usage
> obviously don't apply to dalli, which doesn't seem to have a stats
> command.
>
> Locally on my Mac, things seem to work just fine, based on the
> presence of 'Read fragment views/front_sidebar (0.0ms)' in the logs.
>
> I'm running Rails 3.0.1 and dalli 0.10.0 FWIW.
>
> Then I thought I'd try the standard memcached instead, so I added this
> to my Gemfile
>
> group :production do
> gem "memcache-client"
> gem 'memcached-northscale', :require => 'memcached'
> end
>
> ...and in production.rb:
> config.cache_store = :mem_cache_store, Memcached::Rails.new
>
> Unfortunately, despite the :production group, when I went to do a
> bundle install locally first, it tries to compile native extensions
> under Mac OS X for memcached-northscale, and I get a compile error
> that's been discussed here too:
>
> http://osdir.com/ml/ruby-talk/2010-02/msg01693.html
>
> Should I be able to tell bundle what environment to run under, so that
> it'll ignore that on development and thus bypass any attempt to
> install memcached-norrthscale?
--
You received this message because you are subscribed to the Google Groups
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en.