views:

223

answers:

3

Starting a new web app with Rails 3. I'm still relatively new to web development and have really enjoyed all the internet resources available to me while working in Ruby 1.8.7 and Rails 2.3.5. Any advice against using Ruby 1.9.2 on my new project?

+2  A: 

It ultimately depends on what the project is. If it is a personal project, and you are using it as a means to learn Ruby/Rails, than I think it would be worth learning and using the latest tools. If this is client work, or a project that your main goal is just to complete the thing, 2.3.5 / 1.8.7 would probably be the best choice, because of resources as you mentioned, and a lot of supporting libraries/gems will just work. You will have to learn Rails 3 / Ruby 1.9.x at some point because that's definitely where the community is headed.

I would do some research and see what gems you will need for your project, and make sure that everything is supported if you choose the Rails 3 / 1.9.2 route. Also, join the irc and ask around about other people's experience with whatever gems are in question.

I can tell you that I have a small Rails 3 / 1.9.2 application that runs just fine in production, although it is very small and a personal project.

bobbywilson0
Thanks for the insight. I didn't think about gem compatibility. This isn't for a client but it is meant for serious production. I'm leaning towards going with it.
ScotterC
Unless you are using some fancy character encoding in your application, gem compatibility will be your biggest issue. A lot of gem developers are working on Rails 3 compatibility, and most of the popular gems have at least something working for Rails 3, even if it is beta.
bobbywilson0
I agree, plus 1.9.2 was just released so there may be a few bugs in there still...
rogerdpack
@rogerdpack: How will these bugs be found out if nobody uses them? No release is perfect, but people need to start moving over to the latest.
Ryan Bigg
Found a good site for gem compatibility http://railsplugins.org/ lists (in colorful format) what gems work for rails3, ruby1.9.x etc.
ScotterC
+3  A: 

I have been successfully converting all my Rails projects (except one, but I'm working on it) from Ruby 1.8.7/Rails 2.3.5 to Rails 3.0.0 and Ruby 1.8.7/1.9.2 RC2 and both environments are pretty stable.

Fortunately, things changed since I posted this question.

Rails

Unless you really have something that prevents you to do that, I strongly encourage you to start with Rails 3. The effort required to upgrade an application from Rails 2 to Rails 3 should discourage you from starting from Rails 2.

Talking about plugins and Gems, many developers are starting to convert their libraries to Rails 3. Currently there's a very high level of compatibility. Furthermore, Rails 3 focused plugins tends to be quite more powerful to the Rails 2.3 ones, thanks to the new Rails plugin API. They can load tasks, they no longer abuse monkey patching or rely on internal hacks.

Also, Rails 3 is just around the corner. Unless your project will be deployed in 1 week, the stable version will probably available before you deploy your code. I this would not happe, consider that I'm currently managing a couple of Rails 3 project in a production environment and they are pretty stable (Rails 3 RC1, the Beta 4 has a really weird bug in the caching environment).

Ruby 1.9.2

Ruby 1.9.2 is way more powerful than Ruby 1.8.7. If this is a brand new project, I suggest you to use the 1.9 branch.

Usually, it's more easy to start a new project in Ruby 1.9 than converting an existing one.

Ruby 1.9.2 is faster, even more faster than REE. The most part of the common Ruby 1.8.7 Gems work with Ruby 1.9 except a few ones, such as RCov. Again, it's very hard you're going to need a library which doesn't work with Ruby 1.9.2.

If it happens, chances are this is an outdated library and a better replacement is probably available in the Ruby ecosystem.

If you can't find an alternative, remember that Rails 3 provides an excellent way to use custom libraries, thanks to Bundler. You can fork the project and ask Bundler to use your fork. You can even integrate the library in your repos and ask Bundler to load the library from a path.

Conclusion

From my personal experience, I've been very happy with Ruby 1.9.2 and Rails 3. This is by far my favorite environment and my default environment for new projects.

If you can't use Ruby 1.9.2 try with Ruby 1.8.7. On the other side, I strongly encourage you to start with Rails 3.

Simone Carletti
Started with Rails3 and Ruby 1.9.2 and am absolutely loving it! All the things that didn't come easily in Rails2 have gone out the window and been replaced by good Rails3 RESTful lovin such as the new routes and ActiveRecord query
ScotterC
+1  A: 

You might want to try out Ruby 1.9.2 by using RVM http://rvm.beginrescueend.com/

I've been using it off and on to develop some Rails3 apps while maintaining our current production sites (all the way down to Rails 2.2 / Ruby 1.8.5). Only gripe being having to remember to start RVM up ^^

Pasted
Love RVM. Makes live much easier.
ScotterC