View Full Version : Ruby on Rails
rsanheim
06-03-2005, 02:02 AM
Has any setup ruby on rails to run via mod_ruby or light http? Any experiences to share?
navjeet
06-19-2005, 05:22 AM
I performed the following steps to get ruby on rails working. I think I have listed all the steps in the right order.
- Do not install ruby from apt-get as it installs 1.8.1, rails needs 1.8.2, if you have already installed 1.8.1 uninstall it (apt-get remove ruby)
- Had to install zlib-devel using apt-get, before installing ruby 1.8.2 from source, otherwise gem does not get installed properly. Run command 'apt-get install zlib-devel'
- Installed ruby 1.8.2 from source (download source from http://www.ruby-lang.org/en/20020102.html). Ran configure, make and make install. Verfied ruby works and check version by running ruby -v.
- Get gem tar file from rubyforge (http://rubyforge.org/frs/?group_id=126&release_id=1885), unzip and untar file
and run 'ruby setup.rb'
- Run 'gem install rails'
Did all above steps as root
- Edited httpd.conf
Under <Directory "/var/www/html">
</Directory>
changed AllowOverride None
to
AllowOverride All
- Edited config/database.yml to added line
socket: /var/lib/mysql/mysql.sock
- Commenting out line
“require ‘active_record/vendor/mysql411’” in /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.1/lib/active_record/connection_adapters/mysql_adapter.rb helped with my packet out of order error
as per URL http://wiki.rubyonrails.com/rails/show/MySQL+Database+access+problem
Hope this helps to get the basic setup of rails up and running on Apache with Mysql. I was following guidelines from the article at http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html to setup a rails application.
--Navjeet
navjeet
06-22-2005, 04:20 AM
I now also have fastcgi setup on Apache to get much better performance running Ruby On Rails. Thanks to Rimu's support team to help me out with that. You will need to compile fastcgi from the source code and tweak fastcgi startup settings to do that.
--Navjeet
If you're finding your FastCGI application is exhausting your VPSs memory, try something like this in your httpd.conf:
FastCgiConfig -minProcesses 1 -maxProcesses 2 -processSlack 1
The defaults are 5, 50, and 5.
More information in the documentation here: http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html
SpaceAdmiral
06-26-2005, 11:35 PM
Had to install zlib-devel using apt-get, before installing ruby 1.8.2 from source, otherwise gem does not get installed properly.
Before reading this, I installed ruby before installing zlib-devel. . . and you're right; now Gem won't install properly. Any idea how I fix this?
navjeet
06-27-2005, 08:52 PM
Try ruby install again by runing configure, make and make install.
--Navjeet
Dan Yoder
07-26-2005, 07:51 PM
I have run under Webrick fine for weeks. I switched to FCGI recently and starting getting seg faults after a few hours of running. Is this is a symptom of the memory use problem? How can I tell how much memory FCGI is consuming? The number of processes did at one point (I think) hit 10. Any help or insight appreciated.
Dan Yoder
07-26-2005, 08:03 PM
Per the FCGI docs, it appears that the option to set may be MaxClassProcess:
-maxClassProcesses n (10)
The maximum number of dynamic FastCGI application instances allowed to run for any one FastCGI application. It must be <= to -maxProcesses (this is not programmatically enforced).
-maxProcesses n (50)
The maximum total number of dynamic FastCGI application instances allowed to run at any one time. It must be >= to -maxClassProcesses (this is not programmatically enforced).
I don't know ... but I am not sure maxProcesses has an effect if maxClassProcesses is greater than maxProcesses.
rsanheim
11-03-2005, 02:32 AM
Anyone have experiences going to the latest Rails (1.0 RC2) on fastcgi or otherwise?
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.