JRuby enters the home stretch for Rails support

We’re on the home stretch now, and Rails is getting more and more solid every day. With you all helping, we should be able to finish off the remaining failures, clean up major outstanding JRuby issues, and kick out a pretty sweet “Rails-supporting” JRuby release in the next couple weeks. — Charles Nutter

I’m not a Java guy by any means, but I don’t think anyone disagrees that this is great news. Why? The idea of dynamic languages on the JVM is very appealing, even Ryan Tomayko thinks so.

Now, being a recovering C# programmer, I had no idea how to get JRuby installed and running. So, here’s a quick newbie guide for you Mac OSX users. If you have good instructions for other platforms beyond what’s in the JRuby blog, please post or link to them in the comments. Also, be sure to use the proper reporting channels for any bugs you come across: the Rails Trac for Rails bugs, and JRuby’s JIRA for JRuby issues.

  • First, you need java. Luckily, it happens to ship with Tiger. “java -version” tells me I have v1.5.0_06. Awesome.
  • I actually set this up over the weekend, and used ‘ant test’ to build and test JRuby. This required me to install JUnit to proceed. I just created a directory to act as my CLASSPATH, and threw junit-4.1.jar in there.
  • Set up a few environment variables (see below for the list).
  • Add /path/to/jruby/bin to your PATH.

export CLASSPATH=/path/to/junit-4.1.jar
export JRUBY_HOME=/path/to/jruby
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export JRUBY_SHELL=/bin/zsh

After this was done, I was able to run jruby or jirb directly. Depending on where you add the jruby/bin path, you may or may not be using the JRuby gem script or not. Use ‘which gem’ to check.

There you go, you should be all ready to help the JRuby folks out.

Build Your Own Ruby on Rails Web Applications

Patrick Lenz wrapped up yet another Rails book: Build Your Own Ruby on Rails Web Applications, published by SitePoint. This one takes a beginners look at the Rails 1.2 framework, building a sample Digg-clone in the process.

Build Your Own Ruby on Rails Web Applications is an easy-to-follow, practical and fun guide to Ruby on Rails for beginners. It covers all you need to get up and running, from installing Ruby, Rails and MySQL to building and deploying a fully featured web application.

Update: Patrick posted a few sample chapters of the book at Sitepoint.

Using SQLite3 with Rails

If you are using SQLite3 with a Rails application, make sure you are using SQLite3 3.3.7 or earlier. Versions after 3.3.7 incompatibly changed the way in which default values are stored, making it so that current versions of Rails get into quoting issues and problems with columns with NULL defaults.

The source code for version 3.3.7 may be downloaded here: sqlite-3.3.7.tar.gz. Likewise, a pre-compiled binary for Windows is available here: sqlite-3_3_7.zip.

I’ve got a ticket open on the SQLite3 trac about this (right here ); hopefully this will be recognized as an unacceptable change for a point release and will be reverted.

Processing Credit Cards

Omninerd published an introduction to ActiveMerchant.
AM is a credit card processing library extracted from Shopify in much the same way Rails was originally extracted from Basecamp.

Processing Credit Cards with Ruby on Rails

The article talks about Authorize.net as a payment provider but ActiveMerchant supports a variety of gateways such as Authorize.net, Moneris, TrustCommerce, LinkPoint, Psigate, Paypal Payments Pro, Paypal Payments Standard, eWay, USA ePay, NoChex and Chronopay. All of the supported gateways are in production use in Shopify.

Hackfest 2007 winners

We’ve reviewed, committed, and scored the patch flood. Congratulations to our twenty RailsConf 2007 Hackfest winners. Truly, a crack team of Rails commandos.

Over 24 days, we saw 263 participants open 462 tickets, submit 527 patches, and make 3169 comments. Great show, all — see you at RailsConf!

Ajax on Rails

Scott Raymond latest book, Ajax on Rails, has recently been published by O’Reilly. He also wrote What’s New in Prototype 1.5? on XML.com regarding the latest changes for Prototype 1.5.

  • The book demonstrates how to use Ajax and Rails to build
    high-performance, scalable applications without having to write reams of
    difficult-to-maintain JavaScript code.
  • Provides a thorough, low-level understanding of what’s under the hood,
    with a high-level understanding of how to use Ajax techniques
    effectively.
  • Includes a complete reference to Prototype 1.5 and script.aculo.us 1.6.1,
    which can be used even outside of the Rails platform.
  • Three fully worked out applications—a quiz program, a photo gallery,
    and a workgroup collaboration tool—show how everything fits together
    in practice.

— taken from the book’s Full Description

Mongrel 1.0

To coincide with Rails 1.2.1, Zed just made Mongrel 1.0.1 official. He also points out that he started working on Mongrel around January, making it around 1 year old too. Congrats to Zed and everyone else that contributed to the application and to the wonderful Mongrel community.

Rails Cookbook

Rob Orsini released the new Rails Cookbook from O’Reilly, just in time for Rails 1.2. Just from looking at the table of contents, it looks like there’s a lot of good information packed in this book.

This book is packed with the solutions you need to be proficient
developer with Rails, the leading framework for building the new
generation of Web 2.0 applications. Recipes range from the basics,
like installing Rails and setting up your development environment, to
the latest techniques, such as developing RESTful web services. Each
recipe includes a tested solution, plus a discussion of how and why
it works. — from the book’s Full Description

Haml 1.0

Since we’re all celebrating new releases, it seems only fair to point out that Haml, an alternative markup format to Rails’ RHTML templates, has reached the lofty version of 1.0. It even comes with a plugin for seamless integration with Rails applications, so you really have no excuse not to give it a try. If you’re looking for an alternative to RHTML, Haml may just be you. Check it out!

Prototype 1.5: Now with a manual!

Prototype 1.5 shipped together with Rails 1.2 today. But that’s not all that’s been happening at the JavaScript sugar mill. Today also marks the official unveiling of prototypejs.org. A brand new site dedicated to promoting and teaching Prototype. It comes complete with API documentation, a blog, and a guide on how to contribute. Congratulations to Sam, Justin, and the rest of the team behind the site.