RubyGems 0.8.6 fixes critical error

So now that you just upgraded to RubyGems 0.8.5, please do so again to 0.8.6. The 0.8.5 version contained a bad bug that would render the rails command to create a new skeleton setup useless. Thankfully, the process is even easier than last time. Just one command: gem update --system.

Rails book slated for late-summer release

Dave Thomas is busy writing the first Rails book and has been making great progress lately. In his blog post Quite a Week For Rails, he says:

I’ve actually finished enough of my new Rails book that I’ve released some chapters to a wonderful panel of reviewers (no more needed right now, thanks). I’m starting to get happy about the way this book is turning out—I’m looking forward to a late-summer release.

The book is naturally to be published by The Pragmatic Bookshelf and distributed by O’Reilly.

Get a life-time TextDrive for $399

TextDrive is our wonderful host. They’re contributing big time to the development of Rails and are up to date with the latest (like exploring lighttpd as an Apache alternative). They’ve won the heart of many big-time Railers, like the Pragmatic Programmers, Scott Barron, Marten Veldthuis, and many others.

Now they’re offering you a limited opportunity of a life-time account for just $399. The drive is called VC II and is a very interesting way to allow users to expand the company’s ambitions by getting something in return and keeping foreign capitals (and the onslaught of strings attached) out.

Better be quick, though. The last drive they did sold out in no time fast.

Installing Rails through RubyGems 3x faster!

RubGems 0.8.5 has been released and turbo-charges the installation of new gems and updating of the repository lists. In general, it’s about three times faster than the old version. All you have to do to update is:


gem install rubygems-update
update_rubygems

Bruce Tate discovers Ruby on Rails

Bruce Tate is the author of Bitter Java and Bitter EJB, so if you were just judging by the titles of those books, you may not be too surprised that Tate is at least interested in an alternative. There’s a long way to get a conversion out of it, but Tate at least haves Rails on the radar and are seeing some of the possibilities:

Which brings me back to Ruby on Rails. It’s got that magic. I’ll just give you a little taste. When you’re mapping a Java class to a schema, you must often type the name of a property five times. FIVE TIMES Count them. Three in the bean: the getter, the setter, the instance variable. One in the schema: the field. Two in the mapping: the property, and the column. In Ruby, you type it once. Reflection and inspection of the database handle the rest. You use intelligent defaults and naming conventions to handle the rest. You can always override differences, but you don’t have to.

Keeping DRY is a big part of what makes Ruby on Rails special compared to the Java world. Getting rid of the bane of compilation in the development cycle is another big one.

Rails 0.10.0 loves lighttpd

With the release of Rails 0.10.0, the reign of Apache has finally ended and equal opportunity for all web servers has been introduced. The most important beneficial of this is lighttpd. The server describes itself as “…a secure, fast, compliant and very flexible web-server which has been optimized for high-performance environments” and is catching the attention of a lot of people lately.

Personally, I’ve been most interested in its FastCGI implementation that includes a load balancer component. But whether you need that or not, you owe it to yourself to check out lighttpd. Here’s a sample minimal configuration file needed to setup lighttpd to run a Rails application under FastCGI:


server.port = 8080
server.bind = "127.0.0.1"
# Needed on OS X: server.event-handler = "freebsd-kqueue"
 
server.modules = ( "mod_rewrite", "mod_fastcgi" )
 
url.rewrite = ( "^/$" =>"index.html", "^([^.]+)$" =>"$1.html" )
server.error-handler-404 = "/dispatch.fcgi"
 
server.document-root = "/path/application/public"
server.errorlog      = "/path/application/log/server.log"
 
fastcgi.server = ( ".fcgi" => ( "localhost" => (
 "min-procs" => 1,  "max-procs" => 5,
 "socket"   =>"/tmp/application.fcgi.socket",
 "bin-path" =>"/path/application/public/dispatch.fcgi",
 "bin-environment" => ( "RAILS_ENV" =>"development" )
) ) )

This configuration is also to be found in the README file of new Rails installations.

Rails for Strut-ters: Dealing with the view

Brian McCallister is doing an excellent job showing Strut-ters how Rails work by comparing it to their own environment. In this round, he’s taking a look at the oh-horror that is unleashing a real programming language on view logic. He finds that perhaps it’s not so bad at all comparing:

<% for invite in @invitations %>
  ...
<% end %>

…from Rails to the JSP approach of tag libraries with:

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
...
<logic:iterate name="invite" property="invitation">
  ...
</logic:iterate>

Indeed they do look similar. For more on that discussion, read my views on template languages and why the scriplet approach works in Rails.

As a sidenote, I’d like to suggest a few improvements to the tag/value mix that Brian has in his examples. For example, we could convert:

&lt;form action="<%= url_for :action => 'register', :controller => 'rsvp' %>">  
...
   &lt;input type="text" 
          name="invite_names[&lt;%= slot %>]" 
          length="30"&lt;%= "value='#{@invite.split_names[slot]}'" %>/>
...

To use a few more succinct FormTagHelper helper methods:

&lt;%= form_tag :action => 'register', :controller => 'rsvp' %>
...
&lt;%= text_field_tag "invite_names[#{slot}]", @invite.split_names[slot] %>

But that’s nitpicking. Brian is doing a fabulous job expressing the unknown in familiar terms. If you’re in need for something more visual on the Helpers, see this video demonstrating how to create a helper method in Rails.

What if I could just use Ruby on Rails...

Jaikoo wonders what the world would look like if he could just develop purely in a dynamic environment:

One of the things I’m currently working on is this massively complex J2EE application running on JBoss. The thing I still can’t get used to is bouncing Apache (thats running a full blown Rails app). I mean it starts from cold in like 3 seconds on my live server. That can’t be right? After all JBoss 3.2.3 takes around 5 minutes to startup on the equivilent server. Yes, I know I’m comparing apples with oranges, but sometimes I just wonder how much more productive I’d be if I developed purely in dymanic languages such as Ruby or Python.

Of course, during development you don’t even have to restart anything to see your changes instantly reflected. It’s change’n’reload, baby.

Odeo is launching on Rails

Evan Williams (of Blogger fame) and friends have unveiled their latest venture: Odeo. It’s going to make “…it easy for you to discover, create, and subscribe to fresh, independent audio content for your iPod”. In short, Portal for Podcasting. That hook got the interest of The New York Times, but to get the full story, you’ll be well advised to read Evan’s blog posting about it and the Odeo blog in general.

I had a sneak peak at the application a few days ago and it looks mighty cool. I’m a big fan of podcasting myself (especially from the ever excellent ITConversations), so the prospect of Odeo makes me pretty excited.

What also makes me excited is Odeo running Ruby on Rails. Remember that posting Evhead advertises for a Rails developer back in the beginning of December? That resulted in the hiring of Rabble as the lead developer on Odeo. He talks about the Odeo launch and how they “…built it with the wonderful Ruby on Rails framework” in his blog.

So congratulations, guys! It’s great to see another high-profile site launch on Rails and loving it. Keep ’em coming.

Rails 0.10.0 is a Ruby 1.8.2 framework

It’s time to upgrade to Ruby 1.8.2, folks. Rails 0.10.0 includes various bits that require this version of Ruby, so if you want to run the latest Rails, you’ll have to get on the latest Ruby too. You’ll be glad you updated anyway. Ruby 1.8.2 contains a year’s worth of fixes, additions, and goodies from the Ruby masters. It’s an insult to them if don’t get jiggy with the goods (and Rails developers have other things to worry about that testing across old Ruby versions). Oh, when you upgrade, be sure to patch test/unit.