Development with Rails + Passenger (AKA mod_rails) on Mac
Back-End Full-Stack WebPassenger, AKA mod_rails
2 min read
Jan 15, 2008
For a recent Rails project, I had to use PostgreSQL instead of the standard MySQL for the database. Setting up Postgres on Mac OS 10.5 has some quirks, which I will share with you here.
1) install Postgres as root
2) after install, from the command line: chown -R andre /usr/local/pgsql/data. The -r flag changes the ownership recursively. Obviously, substitute your own username for “andre” in the example.
alias startpostgres=’/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile start’ alias stoppostgres=’/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/logfile stop’
FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=1, size=1081344, 03600). HINT: This error usually means that PostgreSQL’s request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 1081344 bytes), reduce PostgreSQL’s shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10).
/etc/sysctl.conf
(if it does not already exist – mine didn’t), and add the following lines:kern.sysv.shmmax=167772160 kern.sysv.shmmin=1 kern.sysv.shmmni=32 kern.sysv.shmseg=8 kern.sysv.shmall=65536
You’ll need to su to root to create /etc/rc
Have fun with Postgres!
Passenger, AKA mod_rails
Hotspotr – my community-driven WiFi hotspot site – announced a content-providing partnership with LightPole today. You can read the press release over at http://lightpole.net/press/index.html.
Staging environments are the perfect excuse to dig into new server configurations, and to play around with tools like Deprec. I have covered the...