Awesome, very informative. I see in my ENV hash the following entry:
MEMCACHE_SERVER : mc2.ec2.northscale.net Is that the memcache server I should be using? I see I can get the app URL there as well, as you said, so I can use that if memcache is running at that URL. Thanks! Cheers, Carson On Dec 18, 11:38 am, Jason Morrison <[email protected]> wrote: > Hi Carson, > > Heroku exposes addon parameters as config vars, which are populated as ENV > vars available to your app: > > https://gist.github.com/597532192c16b13f4a2d > > Similarly, you can access ENV['APP_NAME'] to fetch the app name, and > ENV['URL'] for the app base URL. Pop open `heroku console` and inspect the > ENV hash - a bunch of neat stuff in there. You can set the RAILS_ENV with > config vars, too:http://docs.heroku.com/config-vars#rackenv-railsenv-merbenv > > Hope this helps, > -Jason > > > > > > > > > > On Sat, Dec 18, 2010 at 9:59 AM, Carson Gross <[email protected]> wrote: > > Memcached/rube/rails/heroku newb. Apologies in advance. > > > The docs here:http://docs.heroku.com/memcachegive this for the > > memcached config: > > > # Session cache > > ActionController::Base.session = { > > :namespace => 'sessions', > > :expire_after => 20.minutes.to_i, > > :memcache_server => ['server-1:11211', 'server-2:11211'], > > :key => ..., > > :secret => ... > > } > > > require 'action_controller/session/dalli_store' > > ActionController::Base.session_store = :dalli_store > > > First question: is 'server-1' our app url? ( > > > Second question: is there a way to get the name of the current app? > > We run a few versions of our app (staging, production, and, obviously > > locally on our own machines) and I obviously don't want them all going > > to our production memcache instance. What's the orthodox way to > > parameterized the server url, and then is there an orthodox way to > > derive that from the environment? > > > Thanks, > > Carson > > > -- > > 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]<heroku%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/heroku?hl=en. > > -- > Jason Morrison > thoughtbot.com > 585-216-5657 > @jayunit -- 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.
