iCoreTech Research Labs Just a placeholder

19Aug/092

Passenger (mod_rails) $PATH on Leopard / Snow Leopard

Passenger uses a little subset of your PATH.

So if you have installed ruby, gem and misc binaries in other paths you cannot access them via your passenger rails application.

Create an executable script ruby_with_env, I wrote it in my /usr/local/bin:

1
2
3
4
#!/bin/bash
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/graphviz/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin:/usr/local/git/bin/
:$PATH"
/usr/local/bin/ruby $*

Now point the file to your PassengerRuby directive in your apache configuration file and restart.

Related posts:

  1. Install Passenger (mod_rails) in Snow Leopard 64 bit
  2. Install MySQL and MySQL Ruby gem on Snow Leopard, 64 bit
  3. Installing MySQL Ruby Gem in Snow Leopard Server
  4. CentOS “gem install mysql” problems, solution

Comments (2) Trackbacks (0)
  1. Thanks, this is very helpful — and applicable to any platform (linux, solaris).

    One point was confusing: “Now point the file to your PassengerRuby directive in your apache configuration file and restart.”

    What it means is kind of the reverse: set PassengerRuby to this new file — so the apache configuration is something like this:

    PassengerRuby /opt/local/ruby/bin/ruby_with_env

    This worked great for me with Passenger + Ruby Enterprise Edition. I had gems calling `git clone …`, and of course, git was not on the limited $PATH that Passenger was using.

  2. @David Reese
    hi David, thanks for pointing it out, as a non native english speaker stuff like this often tend to miss my double checks, I’ll enrich the post soon, which actually is very raw because I copy/pasted it from my notes.


Leave a comment


No trackbacks yet.

Additional comments powered by BackType