Rails FTW with Rails 3.0.1 and mysql2 adapter now up

yayifications!

With mysql2 now working on Windows here’s a small update to my hacked together Rails on Windows installer. I also took the opportunity to update the Rails to 3.0.1.

Also replaced the libmysql.dll with the one from MariaDB. That should probably be enough to keep the Oracle lawyers at bay…

Download Rails For (the) Windows v0.2

latest version is v0.4. grab it here

Rails FTW, now with MySQL support!

One of the questions raised during the last Rails training course I held was “Can Ruby on Rails work with XAMPP?”

With this new version of Rails FTW, the answer to that question is YES.

installer

Download Rails For (the) Windows v0.1

latest version is v0.4. grab it here

OK, so this version doesn’t install mod_rails on XAMPP, but it does allow you to get around the headaches involved in making Rails 3 work with MySQL on Windows.

Here’s a basic rundown of the changes from the last installer:

  • The mysql2 gem still doesn’t work for Windows so I included the old mysql gem instead.
  • Like what I did with SQLite in the previous installer, I’ve included the DLL for MySQL (libmysql.dll) in the bin folder. MySQL 5.1 doesn’t work with the mysql gem so I used the DLL file from the latest “no install” package for MySQL 5.0 (mysql-noinstall-5.0.91-win32.zip).
    I know, Oracle will probably sic their lawyers against us if they catch wind of this project. Hopefully the MariaDB or SkySQL guys would give us an open replacement DLL file in the future.
  • I’ve modified the Railties gem to replace instances of mysql2 to mysql (e.g. database.yml, Gemfile).
  • Minor change: add a line to config to remove log coloring (useless in Windows)
  • Minor change: in the installer, the Add to PATH option is checked by default
  • Minor change: remove gems from gem cache to reduce installer size (a facepalm moment -_-)

Rundown of the quick blog app demo using this installer below the cut.
Continue reading “Rails FTW, now with MySQL support!”

Advanced Math and Software Development

laplace expansion

Back in college, we Computer Science guys had the distinction of having the second highest number of Math related classes in the university (BS Math obviously comes first). Given what I said about college education in a recent post, you might think that I would’ve preferred if the curriculum didn’t have those classes, and instead added classes on web development and design patterns.

I actually think otherwise.
Continue reading “Advanced Math and Software Development”

Rails FTW!

Second Rails post of the week. I don’t really mind since it’s just going to be a small post and would let me reach my 2 post per week quota this early.

Rails for Windows

Remember that post about Ruby on Windows? Well, one thing led to another and PhRUG thought it was a good idea to fork the RubyInstaller to create an installer which includes everything one needs to create a Rails 3 app (Ruby + Rails + SQLite). Being the sneaky guy I am, I decided to create a proof of concept installer by hacking away at the RubyInstaller source code.

Here’s that installer: Rails For (the) Windows, version 0 (edit: latest version is v0.4. grab it here)

With this installer, you can create Rails apps in just a few steps:

  1. Download and run the RailsFTW installer.
  2. Start Command Prompt with Ruby. If you ticked “Add Ruby executables to your PATH” in the install process, you can simply open a normal command prompt

Command Prompt

From there, you can now create the 5-command rails app:

C:\Users\me> rails new blog 
C:\Users\me> cd blog
C:\Users\me\blog> rails generate scaffold entry subject:string content:text
C:\Users\me\blog> rake db:migrate
C:\Users\me\blog> rails server

You may have to unblock ruby in the firewall prompt to make the server work.

Open http://localhost:3000/entries to see your new app.

blog app

We still have a long way to go before we could supercede InstantRails, but this little hack job looks promising. Luis Lavena, a main contributor to RubyInstaller, even approves of this venture. Maybe later we could move on to other Ruby frameworks… Merb FTW or Sinatra FTW anyone?