Yes, I got it working!
A couple of days ago, I was able to successfully setup PHP4 and PHP5 running side-by-side on my server. Since this setup requires PHP5 to run on FastCGI (FCGI), I decided to install Ruby on my server as well. The install was easy with cPanel as I only needed to execute the following line (note that this is on cPanel):
chmod +x /scripts/installruby; /scripts/installruby
That alone downloaded, compiled and installed Ruby and Rails. Since FCGI is already setup on my server, I decided to give Ruby on Rails a spin. CGI mode was working fine but when I tweaked the .htaccess to make use of FCGI, it didn’t seem to work. A view of the log file says:
Dispatcher failed to catch: undefined method `is_cgi?’ for FCGI:Class (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:605:in `each_cgi’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!’
dispatch.fcgi:24
OK – that’s ugly. I immediately turned on to my good old friend Google to ask for help. As usual, tons of suggestions from other users came up but none of them worked. An hour and a half later, I came across one blog that recommends to add the following line dispatch.fcgi just before require ‘fcgi_handler’:
FCGI_PURE_RUBY = true
I tried it out and it did work BUT I knew there’s something wrong with this solution. It’s not a global solution and since I run a web hosting business, telling my clients who would use Ruby on Rails to insert that line in dispatch.fcgi would be a no-no. So I searched for a better solution and guess what – I found one! To my amazement, I found the solution at the bottom of the Ruby on Rails FastCGI wiki itself.
The solution was simple and is accomplished in two steps (root access required):
- Edit /etc/ld.so.conf and add /usr/local/lib at the bottom
- Run /sbin/ldconfig
Geez! That was it! Easy as that. Now, I have Ruby on Rails running on my server – more options more clients!
How where you able to install fcgi with cpanel im having problems I dont think I understand cpanel’s easy apache and I think I did the fcgi install as if it where a normal apache setup