Which rails release is the best? [closed] - ruby-on-rails

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
Now Rails 3 has come out, which version is the stable rails edition? Rails 2.3.3 , or Rails 2.3.4 ?

Rails 2.3.3 and 2.3.4 are out-of-date on the 2.x branch. The most recent Rails 2 version is 2.3.9.
The most recent release of Rails 3.x is 3.0.3.
They're all considered stable.

Rails 3 and 2 are both stable. Better use Rails 3 though

In the Rubygems, every release is considered stable, so you'd best choose the latest one.
Only versions that end in something like "pre", "beta" or "rc" are unstable, but unless you specify explicitly that you want an unstable version, you will get a stable one.
Install latest stable version:
gem install rails
Install latest unstable version:
gem install rails --pre

Currently 2x rails version is being outdated. Rails 3x is on step .
Rails 3.0 has been stable .So I will recommend you to move towards rails 3x

Rails 3 is the best one and also stable .

One of the key benefits of working with Rails is the vibrant community and regular iterative improvements that come with it. What that means is the pace of change will continue in all likelihood. Rails 3 has a lot of improvements over Rails 2. Since building on Rails 3.1 (I am currently building a project on rc5) I have to say there are a lot of very good features coming down the pipe (if you'll excuse the pun).
As a result, I'd say work with the newest version you feel comfortable with. Rails 3 is stable and most of the gems you'll use, that are being maintained actively (and you probably don't want to be using gems that were someone's part-time project they've forgotten about, anyway), are updated for Rails 3 and new gems are skipping over Rails 2 in a lot of cases.
So, future proof yourself and minimize the changes you'll have to make later when you want to take advantage of things like the Rails 3.1 asset pipeline, or some of the other features slated for release.

Edge rails i.e. rails 3.1.x is awesome with lot of improvements and bug fixes

rails 4 is on way and hopefully will be released in apr/may 2011. release is likely to disable support for ruby 1.8.7....stay tuned!

i am very happy with 3.0.3. did not have the guts to upgrade to 3.1. At one point i will need to bite the ebullet

Related

What is the latest stable Rails version?

What is the latest stable version of rails? I want to install rails 3.1 but I see there is 3.1.3 now, what is the difference? What ruby version is it most compatible with?
I recommend to always check on GitHub via the "branches" menu what the latest version is on each branch.
You can see the latest version easily by checking the contents of the RAILS_VERSION file
https://github.com/rails/rails
You could also check RubyOnRails.org, but looking at the source code is the most reliable way.
If you already have a Rails App in production, I would highly recommend: don't just blindly take the latest version just because it just came out -- there were many cases in the past where a new version introduced incompatibilities or new bugs which were serious enough to have to wait for a fix before the features in the Rails release were really usable. I know a couple of people who have Production sites and still run 3.0.11 or lower, rather than 3.l.x
Again: check on GitHub under "Issues" which open Issues there are for a release, and/or google "Rails 3.y.z Problems" with the exact version number, so you get a feel of what problems could be introduced by upgrading to a new / the latest version.
On Wikipedia they have a list of historic release dates for the major Rails versions:
https://en.wikipedia.org/wiki/Ruby_on_Rails
The Rails version numbers have been explained reasonably well (Joseph Le Brech's answer), but the Ruby version numbers are slightly confusing and I could see why it's not really obvious what's going on there.
Joseph's explanation of Rails version number scheme is correct for Rails, but Ruby has a slightly different approach
1.9.3 is the most recent version of Ruby. Having said that, it was only released maybe a month ago, so it's possible there are breaking issues with certain gems. (Yes, there were breakages. Ruby in general will introduce breaking things between hotfix releases, and it's true here too)
1.9.2 is a more tried and true version of Ruby, having been out for at least 6 months now.
1.8.7 is the last version in the Ruby 1.8 line. Major language rework happened between 1.8 and 1.9, so some older gems may not have made the transition.
My recommendation: use Ruby 1.9.2 and Rails 3.1.3, unless you have really good excuses not to.
Ruby 1.9.2 is probably the safest bet for a Rails newbie, or green-field projects (projects without a lot of preexisting code). Rails 3.1 is an excellent version of Rails, which solves a lot of problems I had with the framework.
Rails 3.1 was released this fall, so old tutorials won't work, or will give odd errors. Try to look and read what version of Rails the book/tutorial/website/blog entry is talking about, before you dive in.
Latest stable release is always shown on the Ruby on Rails website's home page here http://rubyonrails.org/
To list all rails versions by gem:
gem list -ra rails | grep -G "^rails\ "
It's also helpful for cheeking what is the latest version for 4.x, 3.x and 2.x too.
According to rubygems, it's 3.1.3. Looks like you forgot a ..
major.minor.hotfix hotfixes will never change the behavior of an app unless you previously had a workaround for a bug implemented. Apps can easily be upgraded thru minor revisions, but it's usually not worth it and can be a distraction from getting features out of the way.
The latest release is 3.1.3. This is a minor release which has security and minor improvements.
The main version is 3.1, while minor upgrades are included in 3.1.x releases.
Anyway you should always use the latest one.
usually if you'll pull the latest rails gem, it's the stable one (unless once in history). although you can still use ruby 1.8.x version with the latest rails 3.x, it is more recommended to use 1.9.x.
anyway, everything you might need is in http://guides.rubyonrails.org and some nice people (including myself) are answering all bunch of questions in IRC on irc.freenode.net (#rubyonrails and #railsbridge)
good luck
The latest release is 6.0. it was released on August 16, 2019, making Webpack default, adding mailbox routing. Rails 5.2 is still maintained.

Just starting in Rails --> Is it really buggy these days or is it just me?

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.
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.
In my experience this is not par for Rails development.
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.
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:
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.
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.
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. :-)

Should I use Rails 3 for my application

I have been a user of Rails for a while and used version 2.3.4 recently.
Rails 3 Beta just came out recently and it seems have significant performance improvement especially with the merge with Merb.
I'm planning on building an application that will take 4-6 months. Should I use Rails 3 for it starting with beta? Knowing that it will be buggy until full release?
Performance is definitely an important requirement for my application.
You can help me if you can provide insight in the following questions:
1- Do you think Rails 3 will be out in 4-6 months?
2- Will it be easy to migrate code should I choose to go for Rails 2.3.5?
There are certain aspects to consider:
Does your application depend on 3rd party plugins/gems? If so than you should check if those are already Rails 3 compatible. You're probably gonna find libraries which are incompatible as yet but there is a big chance that these are gonna "get fixed" sooner or later.
Also, it really depends on what kind of application you are talking about. Personally I'm porting one of my 2.3.5 based sites to Rails 3 but only for preparing and learning purposes. Since Rails 3 is only public beta as yet, IT IS DEFINITELY NOT CONSIDERED TO BE PRODUCTION READY. You can download it, use it and play with it but that's pretty much it for now.
If you decide to upgrade one of your existing projects (which I'd encourage you to do) than have a look at Geoffrey Grosenbach's screencast which will guide you through the upgrading process.
There's also an official plugin which contains a handy script that you can use to find out which parts of your application need to be upgraded.
afaik there is no definite release date set yet. another point to consider is on how many rails plugins does your project depend on as i think most of them will need to be upgraded too ...
I think you should do it for version 2.3.5 but always think about Rails 3. Read release notes. For example use this plugin to escape html by default.
Try to use plugins that are ready for Rails 3. Check list here.
Use unobtrusive javascript.

Will upgrading gems break old Rails applications?

I have bunch of Rails apps running on Rails 1.x. I need to upgrade the gems so the question is, will these old apps still work after I upgrade gems?
Thank you.
The only way to be sure is to test, of course; that said, if you want to be sure the application works while you test, I believe that you can run
rake rails:freeze:gems
to copy the currently installed gems to the vendor folder inside your project. If, after testing, your project can use newer versions, run
rake rails:unfreeze
to return to the system installed versions of the gems.
It depends. If you're talking about upgrading to the latest gems that comprise Rails then if the applications use features that were long ago deprecated and subsequently removed, then they will break.
The only way to know for sure is to try it. Look out for deprecation warnings in the development log. Hopefully you have good test suites in place.
It's just like any other dependency. Look at the version number for each gem:
1.2.3
In this case, 1 is the major version. If this number has changed, then definitely do not upgrade. It will require work to use the new one.
2 is the minor version. You should be safe upgrading if only this number has changed, but be careful. Do a lot of smoke tests.
3 is a bug fix release. You can definitely upgrade if only this has changed. It's unlikely only this one has changed after so long, but if that's the case you're safe.
Unfortunately these are only guidelines, and many open-source projects among others do not follow them very well. So take the advice with a grain of salt.
If you are running with rails 1.x and you upgrade the rails gem, your application will break. Rails 2.x is very different.
Concerning other gems, they might break. Read the releases note, usually authors warn about backward compatibility.
If you don't want to upgrade, you could also freeze the gems.

What are the benefits of using the Rails gem instead od vendor/rails?

I recently started working on a small personal project in Ruby on Rails, and have run into a few things that I couldn't find definitive answers for. If anyone here is knowledgeable enough to help, that would be greatly appreciated. All of my questions are below:
What benefit is there to using the Rails Gem instead of having it in vendor/rails?
Is there any benefit to using Rails 2.3.2? Some of the plugins I hoped to use don't seem to be compatible with 2.3.2 (ActiveScaffold)? Does it offer a great improvement over 2.2?
What is the benefit of using Ruby 1.9? Many plugins aren't yet compatible. Does it offer a great improvement over older versions?
Thanks for any help you guys might be able to offer.
vendor/rails probably makes your project more portable. Deployments that run the rake gems:install can act kind of wonky, especially if you upgrade a "Framework Gem" (you have to do these manually).
The downside to vendor/rails is that it makes your deployment slightly bigger (more files that have to be pushed) but if you use git and something like Capistrano, this only bites you on the initial deploy... but its not that bad.
I don't think there are any huge benefits; it just depends on if you need features from 2.3.2. Obviously you want to try to run the latest version to make upgrades less painful. I've found that you always need to be upgrading the framework underneath Rails if you want to have any change of upgrading in the future.
Performance. As you pointed out though, a lot of plugins are broken. This is sort of a chicken-and-egg problem but overtime this should fix itself. We're not running 1.9 yet in any of our production apps because its too unstable with the rest of the stack.
I'll address the gem question.
I've used vendored gems in the past but I have pretty much moved away from it except in the rare case where I need to fork a gem to customize it for some purpose in which case I would vendor the gem.
The main reason not to vendor from my perspective is that you can't cleanly vendor any gems with C modules since they require compilation.
A really good option is to use a gem management tool such as geminstaller, it lets you configure the gems and specific versions of gems that your project works against so that you have a consistent set of gems on your deployment.
What benefit is there to using the
Rails Gem instead of having it in
vendor/rails?
The biggest benefit is that you do not carry around the full rails source code with your project, the other benefit is that moving to a newer version of rails is going to involve less effort.
Keep in mind that the gem command will allow you to install a specific version of a gem.
Is there any benefit to using Rails 2.3.2? Some of the plugins I
hoped to use don't seem to be
compatible with 2.3.2
(ActiveScaffold)? Does it offer a
great improvement over 2.2?
A lot has changed from rails 2.2 to 2.3.2, there are also a bunch of security, performance and bug fixes. ActiveScaffold is compatible with rails 2.3.2, as are most of the plugins out there. If you are starting a new project I would recommend using the latest and greatest.
What is the benefit of using Ruby 1.9? Many plugins aren't yet compatible. Does it offer a great
improvement over older versions?
Ruby 1.9 is much faster than Ruby 1.8.x, however adoption of 1.9 is not that high. Rails 2.3.2 works just fine on Ruby 1.9, however there are some plugins and gems that do not. Make sure you read this stackoverflow question on the topic.

Resources