Category: Ruby on Rails

To Rails 3 or Not to Rails 3, That Is The Question

The release of the web framework, Ruby on Rails 3, may lead to some pretty interesting decisions for current Rails developers.

The description of Rails 3 from the Agile Web Development with Rails 4th Edition (beta) book from the Pragmatic Programmers web site sums it up pretty well:

Rails 3 is a major release—the changes aren’t just incremental, but structural. So we decided to follow suit. This book isn’t just a mild reworking of the previous edition to make it run with the new Rails. Instead, it’s a complete refactoring.

Rails 3 introduces many new things, many new conventions.  Version 3 looks more like a new framework, rather than just a version upgrade.  Previously, the amount of effort to move from one Rails version to another was pretty small and unit tests helped reveal problems.  We still rely on our unit tests for this purpose but the effort is not as small.

Rails 3 does offer many fantastic new features and the new architecture attempts to fix problems and areas where the current Rails framework falls short, but at what cost?   I have heard people say over and over, moving to Rails 3 is difficult.  Will this prevent migrating projects to Rails 3?

Jeremy McAnally has written a great ebook titled Rails 3 Upgrade Handbook where he outlines the tasks developers will face when moving existing Rails applications from version 3.   To quote Jeremy from the book about moving applications to Rails 3:

The new features, performance improvements, and API changes aren’t incredibly drastic, but they do present great opportunities (and challenges) to those looking to upgrade existing code to the newest version.

Jeremy also has a plugin that became an official Rails plugin that helps guide the developer through the upgrade process.

I know with certainty there are Rails developers concerned up moving existing code to a new Rails, new conventions.  One of Rails strengths are the convention it employs and as developers we learn the intricacies of our framework the hard way.  Rails 3 will require an education to learn the new conventions.

Could this be a point in time where faithful Rails developers move on to a different framework? I doubt devotees won’t, but maybe some.

Active Server Pages

Case in point, Microsoft Active Server Pages.

I have witnessed and been involved with this before when Microsoft created a web framework named Active Server Pages, referred to ASP.  After a much successful growth of ASP developers, Microsoft decided to create ASP.NET which is their current web framework based on webforms.

The problem was that even though the product names were very similar, the truth was they were drastically different.  Developers were faced with:

  • No upgrade path – code written with what we refer to today as “Classic ASP” could not moved to ASP.NET.  It required a complete rewrite since the programming model was different than ASP.
  • Big learning curve – Classic ASP uses a scripting language where there was a single page with logic in the page, ASP.NET moved to a page with a code-behind page in either C# or VB.NET.  The two are very different and someone versed in Classic ASP had to learn everything from the ground up

Developers were faced with making the jump to ASP.NET or deciding to move on to something else, leaving behind the gripes of Microsoft.  Some moved to PHP, as it resembled ASP more than ASP.NET.  Some moved to legacy ASP project to Rails, the views looked more like ASP than ASP.NET

Rails

Up until this point, Rails has been a pretty smooth transition from version to version, even when applications were running older versions of Rails such as 1.2.x and moving to 2.x was pretty straightforward.  I moved many Rails 1.2.6 applications to 2.x and faced little major issues, certainly not a rewrite.

This is not the case when moving to Rails 3, there is no smooth upgrade path and users will be forced to rewrite significant parts of their applications.

The architecture of Rails has changed in a big way, mostly by Yehuda Katz of Merb fame.  Rails 3 takes the good from Merb in many ways, as I would expect.  The view from 50,000’, Rails 3 does not closely resemble Rails 2.x as we know it today.

A Fork in the Road?

As was the case with Classic ASP, I think developers either bit the bullet and rewrote their applications with pain and learning, stayed put and are still there today or moved to a different web framework, maybe Rails, maybe PHP.

I think we are at this point with Ruby on Rails.  Developers are faced with the task of moving to Rails 3 and making that technical leap, not to a new programming language as with ASP.NET, but a new framework.   Rails 3 is different enough from any previous version that moving existing application will not be a rewrite but a change enough to be a considerable effort.  Rails developers are well versed in how the framework functions, Rails 3 is very different.

An Opportunity?

This may be an opportunity for other frameworks to gain some traction.  New developers considering Ruby on Rails 3 have a bigger challenge with the framework, it is not exactly the framework DHH developed only a few years ago.

Other frameworks worth considering:

  • ASP.NET MVC – from Microsoft, allows developers to use C# and VB.NET to create scalable web applications pretty easily.  It also has good community support.
  • Django – a Python-based web framework which has many great features and productivity points.  Django has been around for a few years now and gaining a good amount of traction.
  • Sinatra – a Ruby-based framework with a simple, yet powerful implementation.

I could be wrong here but I think the advantage Rails had with an easy-to-learn framework, great productivity and easy upgrades will be a bit strained in Rails 3.

This will surely be a great opportunity for developers well-versed in Rails 3 to start or expand consulting career helping companies with existing Rails code bases upgrading to Rails 3.  I think these folks will be in high demand.

Conclusion

So what will happen?  I don’t know. Rails is a great framework but converting a large code base is going to be a challenge and Rails 3 is the future, not the 2.3.x code base.

I know I have asked more questions than I have answered.  I hope the powers that be in the Rails leadership understand the concern.

UPDATE: As comments have pointed out, if this sounds Rails-negative, it is not meant to be.  I see this a call for people with knowledge of Rails 3, bits of experience with upgrading projects of any size to share the knowledge.  Blog about what you did, even the most mundane details and share what you know so jump ship DOES NOT happen.

Acts As Conference 2009 Dates and Venue Announced

aac_badge_xl

The second annual Acts As Conference 2009, a regional Ruby conference, dates and venue has been announced.  The event will take place February 6 & 7, 2009 in Orlando Florida at the Ramada Orlando Celebration Resort & Convention Center, located near all things Disney.  One of the best parts about the event is the cost…only $125.

The venue is different than last year and has the capacity for 175 attendees.  The line-up of talks will include lightening talks as well as more talks than last year.  Robert Dempsey, event organizer, says a call to for papers is coming soon, so get your talk ready.

Keep up with what is going on with this conference on their mailing list.   You can also help spread the word by putting a badge on your web site like the one at the top of this post.

I attended the last acts_as_conference, had a great time and met many people.  I intend on heading down this year as well to enjoy some more mingling and the warm Florida weather after enduring winter here in New England.

Technorati Tags: ,,

Ruby on Rails 2.1 Released at RailsConf

I was supposed to be at RailsConf this year covering the event for InfoQ, but I am not there.  Sometimes higher priorities overtake the things we would like to do and well, I am home. rails

One of the announcements I thought might be coming at the event was the release of Ruby on Rails 2.1 and sure enough, it was released.   The details are covered on the Riding Rails blog:

Rails 2.1 is now available for general consumption with all the features and fixes we’ve been putting in over the last six months since 2.0. This has been a huge effort by a very wide range of contributors helping to make it happen.

Over the past six months, we’ve had 1,400 contributors creating patches and vetting them. This has resulted in 1,600+ patches. A truly staggering number. And lots of that has made it into this release.

New features
The new major features are:

Thanks to Ryan Daigle for the feature introductions and Ryan Bates for the Railscasts. It makes writing the release notes so much easier :) .

As always, you can install with:

gem install rails

…or you can use the Git tag for 2.1.0.

None of these features actually stand out as the killer feature for this release but is instead a bunch of steady, solid improvements.   Installing the update went without a hitch and my applications on my development system all ran without issue.

Notice the Railscast that accompanies the bulleted points above, they make a nice touch.

Technorati Tags: ,

Ruby on Rails and the VM of Your Choice

I think just about everyone in the software development community at least knows what Ruby on Rails is, so I won’t do into it here.   There is some real exciting things going on in the Ruby community and in particular, Ruby on Rails running on more than one implementation of Ruby.  rails

Rails has been running on the original Ruby, Matz’s Ruby Interpreter for a long time now and it runs pretty well.  Recently, other organizations have created new Ruby implementations to compete with the original.

JRuby

JRuby is the first of the new Ruby implementations to successfully get Rails running successfully.   JRuby was an independent open-source project bought by Sun MicroSystems, leveraging the JRuby team and Sun’s knowledge of Java.  JRuby is an implementation of Ruby running on Sun’s Java JVM.

  • A 1.8.6 compatible Ruby interpreter written in 100% pure Java
  • Most builtin Ruby classes provided
  • Support for interacting with and defining java classes from within ruby
  • Bean Scripting Framework (BSF) support
  • Distributed under a tri-license (CPL/GPL/LGPL)

The importance of having a language such as Ruby running with Rails on top of the JVM is really important for the getting Ruby adoption in those organizations heavily invested in Java.  The JRuby team has set a precedent for others to follow, which they have or are close.

Rubinius

Rubinius is a Ruby Virtual Machine written from the ground up from the folks at Engine YardEvan Phoenix is the lead developer for Rubinius.

The Rubinus site details what Rubinius means to developers:

The Rubinius virtual machine is loosely based on the Smalltalk-80 architecture. The small virtual machine is presently implemented in C.

The Ruby core libraries are written in Ruby with some functionality provided by primitives written in C. There is also a foreign function interface (FFI) that enables describing and directly calling functions in system libraries. There is no need to use compiled bindings.

Rubinius has multiple concurrency primitives such as Channels, Actors, Tasks, and Threads. Rubinius is developed in the TDD/BDD style and we are concurrently writing a set of RSpec compatible specs for the Ruby core libraries. Rubinius is also an ideal platform to experiment with various cutting-edge technology like software transactional memory (STM).

The real news about Rubinius is not they are another Ruby interpreter but they recently announced the ability of running Ruby on Rails on Rubinius.  Evan gave the news on his blog:

We hit a major milestone tonight. As most people know, we’ve been working to run Rails on Rubinius by RailsConf to have something to show off, even if it’s pretty slow.

Well, I’m super proud to say that tonight, rails served up both static and dynamic pages under Rubinius. Previous to tonight, we’d been blocked just trying to get Rails to even load. I decided to just try loading it up and bang on it enough to get it up and going.

In a scary way, it didn’t take very much code. Which meant we were very close already.

It’s pretty late, so I’m going to keep this short. Big thanks to everyone who’s contributed to Rubinius and had faith in us. Enormous thanks to Engine Yard, without whom I don’t know if we’d been able to reach this amazing height.

More updates to come…

This is really great news for the Ruby developers, showing there are and will be more options to where and when you can run your Ruby applications.

IronRuby

The last of the Ruby implementations comes from Microsoft with IronRuby.  These project has been in development for quite some time now and takes the folks that made up the RubyCLR project and Ruby.NET projects.  John Lam joined Microsoft as a Project Manager coming with his RubyCLR and Wayne Kelly from the Ruby.NET project is helping the team out.  The team is small within Microsoft but makes up a good number of open source folks who help with the implementation.

Microsoft describes IronRuby as:

IronRuby is a .NET implementation of the Ruby programming language. We are building a high-quality implementation of Ruby, with excellent performance and seamless integration with .NET libraries and infrastructure. We are targeting compatibility with the 1.8.x branch of Ruby modulo continuations.

IronRuby heavily leverages Microsoft’s Dynamic Language Runtime, and both are released with full source code under the Microsoft Permissive License. The IronRuby source code is hosted on Rubyforge, which is a home for open source Ruby projects. We’re looking for contributions to the IronRuby libraries; our goal is to achieve parity with the Ruby standard libraries. If you love .NET and Ruby, then we need your help!

The key part of IronRuby, it runs on the .NET CLR and can take advantage of those large number of existing class libraries and the security of the .NET framework.  This will allow developers to mix their C# and VB.NET code with Ruby take advantage of Ruby’s dynamic features.  Today most Windows servers and desktops have the .NET framework installed, making it an easy to run your Ruby applications.

We undoubtedly can expect great things here with respect to integration to the Dynamic Language Runtime (DLR) and Silverlight, MVC Framework and who knows what else, I don’t think the story here is complete.

As of today the IronRuby team is close to having Ruby on Rails running on the CLR.  I am part of the IronRuby developer list and if I had to guess, I would say by RailsConf 2008 you will see an announcement of Rails running on IronRuby.

Finally

These three alternative implementation of Ruby are really important to the Ruby community.  Each has it strengths and give developers both choice and leverage when trying to move a great dynamic language like Ruby into an organization which may already have a deep investment in Microsoft with .NET or in Sun with Java.  These implementations certainly lower the barrier to entry.

Rubinius comes at Ruby from a different angle creating a Ruby VM written in Ruby.  Why is this important you ask?  It’s important because it opens up the Ruby language to open source developers who may not be skilled in writing C (which is what Matz’s Ruby is written in) but are skilled in Ruby and can help advance the language.  I think most developers miss this point, maybe it is subtle, maybe not, but this is a critical point.

IronRuby has the benefit of being written in C# and developers can help shape that implementation with the abundance of C# developers.

My Interview with Huw Collingbourne up on InfoQ

I have been a happy Ruby in Steel user for quite a while now and have built a bit of a rapport with Huw Collingbourne, co-founder of SapphireSteel Software, the developers of Ruby in Steel.huw1

On Monday, SapphireSteel Software released a new version of Ruby in Steel, version 1.2.  This version includes a new Visual Rails Workbench that allows developers to create Ruby on Rails applications visually as Visual Studio developers have come to expect.

From the Ruby in Steel web site:

The principal features of the Visual Rails Workbench are:

- Full page editing of complete web pages (composites of Rails layouts/views/partials)
- Drag and Drop design – add controls from a toolbox
- Set properties using the Property panel
- Resize and move controls using mouse or keyboard
- Split view code/form editing
- Toggle ERb/RHTML editing between HTML editor and Rails (Ruby-aware) editor
- Round-tripping between ‘web format’ HTML and ‘Rails format’ ERb/RHTML
- Edit code as ERb/RHTML or as HTML
- Document Navigator navigates document structure (HTML)/or methods (ERB/Ruby)
- Quick navigation between controller and view
- Import/Export to other web page design tools such as Dreamweaver
- Save/restore named ‘versions’ of page designs to/from an archive of work in progress
- Auto-backup of changes to templates
- Support for Rails 1 and Rails 2

The Visual Rails Workbench is one of several significant new additions to Ruby In Steel 1.2.

Other notable features include:

- JRuby Support Users may run and debug Sun’s Java-based JRuby right inside the Ruby In Steel environment.
- IronRuby Support Ruby In Steel is the only IDE to offer integrated form design for Microsoft’s IronRuby (currently ‘alpha’).
- Enhanced Debugging Ruby In Steel has the fastest debugger for standard Ruby. In addition to all its existing capabilities (such as breakpoints, watch variables, call stack navigation, step into/out/over, locals, autos, drill-down debugging and debugging into ERb/RHTML templates)

Ruby In Steel 1.2 adds the following debugging features:

  • Tracepoints
  • Conditional breakpoints
  • Break on hitcount
  • Run macro on break
  • Break on exception
  • Autos window user-configuration
  • Dynamic debugging (evaluate code and change variable values on the fly)

I had the opportunity to chat with Huw about Visual Rails Workbench for the interview which can be read at InfoQ.

Ruby on Rails and IIS7 Playing Nicely Together

Ruby on Rails has been around for a few years now and has become a hugely popular web development framework, but not on Windows and Internet Information Server (IIS).  Rails has run on Linux and Max OSX almost exclusively, until recently. 

The Ruby on Rails Wiki has a very good article on setting up Ruby on Rails using IIS7.

Enter FastCGI

FastCGI is the key to getting Rails running in IIS.  The FastCGI web site describes FastCGI as:

FastCGI  is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. See the docs for more details.

Dave Scruggs has a nice short tutorial about his experience getting Rails running on Windows Visata SP1 and IIS 7 with FastCGI.  One of the really nice features of Vista SP1 is that it includes FastCGI built-in. 

In the event you are running IIS7 without FastCGI built in, Dave points out a good tutorial from Carlos Caneja called Install FAST CGI on IIS7.

FastCGI is used to serve applications on IIS7 for languages such as:

  • Ruby
  • Python
  • PHP
  • and others….

What about IIS6?

Most of the recent resources on the web I have seen show FastCGI applications running on IIS7, mainly because it is built-into Vista SP1 and that avoids some configuration difficulties but IIS6 does has FastCGI support for it.  I have not personally attempted it but I may in the future.   The IIS.NET site has some information about using FastCGI on IIS6.

It seems the primary support for FastCGI from Microsoft is on IIS7 but not everyone may be at the point where their web servers are running IIS7 just yet. 

Personal Setup

The tutorials given here are very good and work really well with Vista.  I have a VMWare VM setup on my MacBook Pro running Vista SP1, the setup was flawless.  I have an advantage of many years of IIS experience with a couple years of Ruby on Rails experience, which I think does help.

I would like to see some performance numbers of running Rails or any FastCGI hosted application under IIS.  I am not aware of any but would like to hear back from someone putting IIS and FastCGI through it paces.

Technorati Tags: ,,,

ZigVersion and RailsPlayground Subversion Hosting Rock

I have a few Ruby on Rails applications I maintain outside of the commercial work I do. These applications are important to me but I have been very bad at keeping them in any source control until today.

I use RailsPlayground with a VPS for my personal hosting and I have been very happy with the hosting and the service in particular. I started looking around for a free or cheap Subversion hosting source and was pleasantly surprised RailsPlayground provides this to their VPS clients.

Pretty decent specs compared to some of the paid-for Subversion hosting plans:

Advanced Subversion and Trac Hosting

In addition to your normal webspace with our hosting plans you will receive a free account on our dedicated SVN and Trac Server with the following features.

* 1 GB Disk Space
* 10 GB Traffic
* Unlimited repositories
* Unlimited users for each repository
* Trac installed automatically via our custom control panel
* Your own Bugzilla instance by request
* Nightly offsite backups
* RAID 1 Data protection
* Secure HTTPS and HTTP access to your svn repositories
* Free with any of our current hosting packages.
* Just send an email to support@railsplayground.com to request access to this service once you have signed up.

I sent an email to support and less than 1/2 hour later I had a new account in their Subversion system and ready to go. I am doing much of my Rails work on a MacBook Pro and Subversion from the command line has not been my favorite way to work. I guess I am used to TortoiseSVN on Windows.

Welcome ZigVersion, a SubVersion client for the Mac from my good buddy Mike Gunderloy over at A Fresh Cup. A quick Twitter chat with Mike and I had the answer I was looking for, a great Subversion client for my Mac. The installation was trivial, as usual on the Mac, and connecting to my SubVersion repository was as well.

I simply added my project files via ZigVersion and checked in…done. The user interface is pretty sharp too.

ZigVersion

I am going to use this for my personal projects, since the client is free, but I will also see how well this works over the long-term and may look to buy a license of ZigVersion for commercial work.

I am also looking at using Git since I was lucky enough to score an invite to GitHub but I wanted to get something up fast and I am just get familiar with Git.

acts_as_conference is now history

It’s Saturday night here in Orlando, FL and I just finished listening to Obie Fernandez give the final keynote of a busy two days of talks about Ruby and Ruby on Rails development. The conference was very good, it was hard to believe it was the first time the Rails for All folks put in a conference like this one. The event was sold out with about 150 developers from all over the U.S. I think a conference of this size is really nice where you can sit down with speakers, mingle and get to know many of the attendees.

Meeting New People

I met a lot of new people from all over the country including some people I only knew from blogs or podcasts.

Great Speakers

There were many great speakers at this event, none that I did not enjoy. It was really good to hear the latest about Merb from Ezra Zygmuntowicz, Rubinius from Evan Phoenix and JRuby from Charles Nutter. The presentation from Charles was probably my favorite technical talk. It could be because I learned a lot about JRuby, not knowing too much about it before today. I plan on trying out JRuby along with Netbeans. Sun was a great sponsor as well, having people manning the booth both days. I also enjoyed the talk from Charles Brian Quinn about how to approach training people. This was a talk from real experience and makes training more of a possibility for me to offer down the road. There was also a great talk on working with teams from Luke Fracl, who I was not familiar with prior to his talk. Luke presents very well and his style gives you confidence he knows his stuff. Two of my favorite talks were the two keynotes we had this weekend, the first from Dan Benjamin who talked about building and selling Cork’d. Dan talked about practical views of creating a business, running it, and all around suggestions for running your company. Obie Fernandez was the second keynote speaker, who is one of my favorite authors from his book to his blog. His presentation on practical aspects of being the best developer you can was truly inspiring advice that got me thinking about my own approach to my development work.

Finally

Well, it was a great time! I am glad I spent the time to come down to warm Orlando from my home in CT, where it has been snowing for days. We had a great party sponsored by Rails Machine at the local ale pub and they gang really had their share of ale. The best part was the conversations we had and the friends made. I look forward to seeing some of these same speakers at RailsConf 2008 in Portland, OR May 29 – June 1, 2008. The conference was well organized and I thank all those involved in putting it on.  There was talk about having this event again next year.   I certainly hope so as I plan on attending.

Technorati Tags:

Getting ready to head down to Orlando for acts_as_conference

I am leaving for my flight to Orlando tonight to attend the sold out regional Ruby and Rails conference, acts_as_conferencebadge_med_sponsor

The conference is the first time it has been put on and hopefully it will carry on in future years.  The lineup of speakers looks great and it should be a good time.  I interviewed the creator of the event, Robert Dempsey, back in the beginning of January to give InfoQ readers a feel for what the conference was about.  I was excited about the content so I figured I would sign up.

I am anxious for the Charity Session with  Ezra Zygmuntowicz and Evan Phoenix from the Rubinius Project.

This will be the first conference of the year for me and I will blog a bit from the event.  I am also planning on attending RailsConf 2008 in May.

Heading down to acts_as_conference February 8-9, 2008 in Orlando, FL

I decided to start getting more involved in the Ruby and Ruby on Rails conferences this year and found a new conference to get it started, the acts_as_conference, February 8-9 in Orlando. I blogged about this conference recently and had the opportunity to interview the conference organizer, Robert Dempsey, on InfoQ. I have flight book, room booked and the conference is paid for, so I am well on my way. I am hoping for good weather for the flight down. The lineup of speakers is top-notch and I can’t wait to get down there and hear the latest from the Ruby and Ruby on Rails crowd. The speakers include:

  • Evan Phoenix, Rubinus Project
  • Obie Fernandez, author
  • Ezra Zygmuntowicz, Merb creator and Engine Yard Founder
  • Charles Nutter, JRuby creator
  • Many others……

Let me know if any readers are going as well.

Technorati Tags: ,