views:

159

answers:

4

Hi folks,

I've spent a fair bit of time with PHP & Python frameworks and recently thought I'd branch out to rails. The framework itself I like, but I seem to spend at least half my development time navigating through odd bugs and/or version incompatibilities between rails/ruby/rake/gems.

I'm happy to battle through it all if it gets less of a hassle, but even after a month it seems like I spend 90% of my time chasing down other people's bugs & only 10% of my time chasing down my own. The only guy I've talked to (who used it extensively until 2008) suggests "For the past 2 years, that's pretty much rails"

Any opinion on this? Does it get better, or is this just par for rails development at the moment?

Running it through Ubuntu 10.04, if it matters.

+3  A: 

In my experience this is not par for Rails development.

sosborn
+2  A: 

While using gems read the README file on github project repos and have a look at the issues and wikis....that should give you a fair idea of which gem is compatible with your Rails version. Regarding the framework, it is pretty stable....major bugs or patches or releases are reported on weblog.rubyonrails.org

Things grow incrementally with each release and that is obvious. There are some deprecations which are well documented in the Rails code and are reported when you run the code.

Suman Mukherjee
+1  A: 

Rails itself is pretty bug free. I've not witnessed a bug in the framework itself now for a while unless I've been duplicating open tickets.

Where the problems you're seeing have crept in have been over a couple of different areas:

  1. We've moved as a community from Ruby 1.8.x to 1.9 over the last year or so, and some gems have specific Ruby version requirements you need to check out before using them. Most of the more popular gems are fine and tested to work in multiple environments. Read the docs first.

  2. Rails itself has matured significantly over the last few years, and that has meant many features have been deprecated. Lots of plugins out there were written for an older version of the framework and expect behaviour that just isn't valid any more. Read the docs first.

  3. Several different Ruby interpreters are now available (which is great), but these sometimes can have an impact when it comes to 3rd-party code, but that's rare. Basically, some gems and plugins expect to be running on a specific interpreter. None of the really popular ones are like this, but you need to be aware some gem builders are idiots. Read the docs first.

You might notice there is a common theme to the end of each point: read the docs first. :-)

I would say your experience is not at all typical of most Rails developer's workflows, although we've all had a day of struggling from time to time.

You will learn quickly which gems to trust, which ones you'll need but may struggle with from time to time (mysql - building that kills me on OS X, every time), and which ones you should avoid.

Overall though, the development cycle is more fluid (and you'll develop more rapidly) with Rails once you've got your bearings and are adopting good practice. There's a reason why we all like TDD and BDD though - if nothing else it helps us get through a gem update knowing stuff still works when a developer we don't know has done something moronic. :-)

p7r
+4  A: 

Rails is in transition right now between 2.3x and 3.0 so you are going to find it quite challenging as much of the most recent documentation and rails plugin readmes are being updated for rails 3. There are several tools that are indispensable right now for negotiating this stuff. First, Rails 3 uses bundler to manage dependencies, it is a much more civil way to manage gems.

gem install bundler
cd my_rails_project
bundle install

RVM (ruby version manager) is awesome and I would recommend installing it. Then you can build gemsets and dependency sets on a per project basis. and you don't need to superuser access to install.

also, if it were me, I'd just go ahead and start in rails 3

gem install rails --pre

if you want to stay with rails 2.3.x use the rake task for installing declared dependencies.

rake gems:install

if the project is a good project, it will be pretty specific about what it needs (declared in the config/environment.rb file), then if it doesn't run, checkout the stack traces to see where its failing.

Jed Schneider