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:
- Install Passenger (mod_rails) in Snow Leopard 64 bit
- Install MySQL and MySQL Ruby gem on Snow Leopard, 64 bit
- Installing MySQL Ruby Gem in Snow Leopard Server
- CentOS “gem install mysql” problems, solution
Enjoy this article?
Additional comments powered by BackType
September 6th, 2009 - 06:14
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.
September 6th, 2009 - 06:57
@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.