Categories
os x ruby on rails WebApps

Rails on Nginx with Passenger on Mac OS X Lion

This is a quick and dirty guide to getting Ruby on Rails working on Nginx with Passenger on Mac OS X Lion:

brew install nginx
gem install passenger
cd ~/Library/Caches/Homebrew/
tar zxvf nginx-*.tar.gz 
cd nginx-*
passenger-install-nginx-module 

Now you to edit this file:

/usr/local/Cellar/nginx/1.0.11/conf/nginx.conf

Make sure there’s something like the stuff below:

  server {
        listen       8080;
        server_name  localhost;

        root /Users/me/repos/my_awesome_rails_app/public

        rails_env development;
        passenger_enabled on;

        charset utf-8;
  }

nginx
lynx http://localhost:8080

Guides Online:

http://mrjaba.posterous.com/rails-31-asset-pipeline-with-nginx-and-passen

http://samsoff.es/posts/running-rails-local-development-with-nginx-postgres-and-passenger-with-homebrew

Categories
command-line os x

Darwin Ports when OS X Idiosyncracies Get You Down

I started using Darwin Ports when tools like hping3 and ctags didn’t work quite right on OS X. For example, the berkeley packet filter on OS X is totally different from the one on Linux, so hping3 wouldn’t compile correctly. Also, ctags in OS X doesn’t have the -R flag for recursion.

With Darwin Ports, I can install libraries and executables that don’t work quite right on OS X but work great on Linux.