Monday, 20 July 2009

Setting Up Ruby on Rails on Vista

Possibly going slightly around the houses, but I'm sure similar to other developers who have started using ASP.Net MVC, I've recently started setting up and taking a look into Ruby On Rails. Only had an quick look so far, and had a read through the rails guides to get started - but already can see why it's proved such a popular environment for web development, how it's influenced the development of ASP.Net MVC, and how it's come to promote the MVC pattern more widely in web development circles.

Also probably oddly for a RoR developer, but similar to others from a Microsoft background, I'm running Vista. There are some useful posts out there for setting up RoR on Vista, but as I found a few issues that weren't covered figured it worth noting here.

MySQL Setup


Whilst setting up Rails I also installed MySQL to use as the database. The link provided above provides all the details for installing this. Note though that when it comes to configuring the installation by running MySQLInstanceConfig.exe make sure to right-click and use the "Run as administrator" option - otherwise the latter parts of the wizard won't be able to complete.

There's also a useful recommended step to make the installation more secure by restricting access to the local machine. This is done by adding a line bind-address=127.0.0.1 to the [mysqld] section of my.ini. Note though that you first need to change the security settings to allow modification of this file (right-click on file, go to Properties, go to Security tab, select Edit and click the Modify option).

RoR With MySQL

Finally had a couple of issues with running a simple RoR application running MySQL. This firstly manifested itself with an error reporting that "libmysql.dll was not found". Copying this file from the MySQL install directory to ruby\bin seemed to fix that.

But still the setup wasn't very stable. Every few time I ran the application the WebBrick web server would crash with Ruby interpreter (CUI) 1.8.6 [i386-mswin32] has stopped working. This seemed to be only the case with the latest version of MySQL though. Removing this and installing the previous version (5.0) seemed to resolve this though, as others have found.

No comments:

Post a Comment