Archive for Ruby on Rails

Iconv Support on Windows

By default the inconv.dll is not installed when using the gem installation for rails on win32.

It was necessary to therefore retrieve the latest win32 binaries for libiconv from GNU.

Then, I needed to retrieve the source files for Ruby itself.

The iconv.dll from the GNU sources goes in c:\ruby\bin\iconv.dll.

The iconv.so file from the Ruby-win32 sources goes in C:\ruby\lib\ruby\1.8\i386-mswin32

Note that if this doesn’t work, you’ll need to find the correct version of iconv to use in conjunction withe RoR sources.

Comments

FastCGI on RHEL4

I spent the better part of the morning trying to figure out how to get FastCGI running on one of our corporate servers. For reference, here are the steps I took for RHEL4 with Apache2.Problem:

FastCGI permission denied. Unable to create server in directory

Definitely a permissions problem. Rather than try to muck with the Apache2 setup (okay, I admit I did that first) I decided to just use the FastCgiIpc directive and set it to /tmp/fastcgi_ipc.

Then, chown apache:apache fastcgi_ipc Then, chmod 755 fastcgi_ipc

Ok, that works. But now I’m getting the following error:

.fcgi” has failed to remain running for 30 seconds given 3 attempts…

This really stumped me until I found a small reference in the fastcgi developer’s list mentioning problems with SELinux on Red Hat Enterprise Linux. It seems that SELinux is somehow preventing the fastcgi process to continue. The solution was to change the “targeted” policy in SELinux.

From the GUI: Applications->SystemSettings->Security Level.

Then, go to the SELinux tab and make sure “Disable SELinux for httpd deamon” is checked. I”m going to look into the security implications of this as well.

From the CLI: Go to /etc/selinux/targeted. Open up the booleans file and change httpd_disable_trans=0 to httpd_disable_trans=1.

Restart the Apache2 server.

Comments

Ruby on Rails on RHEL4

I’ve struggled with a few things on RHEL4 (actually CentOS) during my initial review of Ruby on Rails. It’s taken a little getting used to, but overall it’s going to be a great productivity booster at work. This will be added to as new problems are addressed.Mysql.sock not found

It seems as if the default mysql.sock file is located at /tmp/mysql.sock on most linux distros. With RedHat I found it at /var/lib/mysql/mysql.sock, which means that you must configure the database.yml file to include the socket: directive.

e.g. socket: /var/lib/mysql/mysql.sock

Comments