Tag Archives: production

Defining Application Constants for Ruby on Rails Application

The best place to keep application constants which are environment specific is in config/environments directory. For instance… # in RAILS_ROOT/config/environments/development.rb APP_DOMAIN = "localhost" # in RAILS_ROOT/config/environments/production.rb APP_DOMAIN = "real-domain.com" …will set the APP_DOMAIN constant to either “localhost” or “real-domain.com” depending on which environment Rails boots up.
Posted in Ruby on Rails | Also tagged , , , | Leave a comment

Rails: Expiring a cached page with namespaces and sweepers

I’ve got some pages that are cached using their permalinks on the filesystem, such as http://example.com/about-us.html which will need to map to RAILS_ROOT/public/about-us.html … The issue I have is that I use a namespace for the admin area and the controllers in the namespace are responsible for expiring the cached pages, i.e., when the resources [...]
Posted in Ruby on Rails | Also tagged , , , , | Leave a comment

Sample Rails Database Config for MySQL

Sample Ruby on Rails database config file for connecting to mysql. production: adapter: mysql encoding: utf8 reconnect: false database: db_production pool: 5 username: db_user password: db_password #socket: /tmp/mysql.sock #this may vary
Posted in Ruby on Rails | Also tagged , , , | Leave a comment

upgrading to latest phusion passenger 2.1.2

super easy gem install passenger passenger-install-apache2-module will walk you through the install and remember to copy paths to your apache config file. for passenger i kept it in mods-available/passenger.conf and then linked it to mods-enabled ln -s /etc/apache2/mods-available/passenger.conf /etc/apache2/mods-enabled/passenger.conf then just restart apache more info and official docs at http://blog.phusion.nl/2009/03/13/phusion-passenger-212-final-released/
Posted in Programming, Ruby on Rails | Also tagged | Leave a comment