Migrating from restful_authentication to Devise with Rails 2.3.14 - ruby-on-rails

I am in the process of using the rails upgrade plugin (https://github.com/rails/rails_upgrade) to bring the application from 2.3.14 to 3.2. The plugin identified "restful_authentication" as something that needed to be replaced. After some research I decided to try to migrate to Devise.
I started looking at https://github.com/plataformatec/devise/wiki/How-To:-Migrate-from-restful_authentication-to-Devise, the issue I ran into is that these instructions are not meant for Rails 2.3.14.
I can figure out how to make most of it work for 2.3.14, but the biggest block I have ran into is that I am not sure which versions of Devise, Devise-encryptable and other gems to use. Is there an simple way to check?
Alliteratively am I making a mistake in trying to migrate to devise before I upgrade, should it be done the other way around?

Re: Is there a simple way to check? The short answer is no.
To know what Devise gems to use, just follow the directions in the devise wiki - you just need devise and devise-encryptable according to the wiki.
Re: Which one to do first: Whatever you decide to do, its a good idea to have a stable branch before attempting an upgrade. So either you a) upgrade Rails + get restful_auth working, or b) use Devise + upgrade Rails - just avoid trying to do both at the same time.
a) seems possible if you use https://github.com/Satish/restful-authentication . It's a fork of the original project, and neither are as active as Devise ( https://www.ruby-toolbox.com/categories/rails_authentication ). You may choose to upgrade your authentication system to devise anyway, which leads us to...
b) probably the road-more-travelled. You should be able to find plenty of (Rails 2.3) upgrade instructions for restful_authentication->Devise. Get your specs green, then attempt the Rails 3 upgrade.

Related

upgrade ruby on rails application

Currently my application run on rails 3.1.3 & ruby 1.9.3.
I want to upgrade my application into rails 4.1 & ruby 2.1
Can anyone tell me how to upgrade the rails application ?
Thanks in advance
There is no specific defined way to upgrade. You can take reference from http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html or many other blog posts that people have written based on their personal experience. Just google them.
http://www.sitepoint.com/get-your-app-ready-for-rails-4/
https://developer.uservoice.com/blog/2012/03/04/how-to-upgrade-a-rails-2-3-app-to-ruby-1-9-3/
However follow a few points to make it easier. Upgrade one at a time. Better upgrade your ruby first, then rails in second cycle.
Do through testing at each step as the gems are likely to fail due to their dependencies.
Upgrade you gems manually and avoid bundle update
As addition to #shivam 's answer.
Guides often do not contain all the info. And they often do not say why some steps a necessary.
The most professional way is to read the release notes at least for the next major version.
Rails follows semantic versioning, meaning that all following 4.x.x versions are not allowed to introduce breaking public api changes.
Check the Rails 4 Release Notes. Watch out for things marked as deprecated and stuff that was extracted to a separate gem. The best tutorial available is the Upgrading to Rails 4 Screencast.
The most tricky part about the upgrade is the change from protected_attributes in models to strong_parameters in the controllers as a default mechanism against mass assignment protection.
If your app already heavily relies on protected_attributes it can be a tremendious task to move this protection outside of the model to every controller. In that case it is recommended to stick with protected_attributes by just including them as extra gem(same name).
In case of the ruby update. You can almost safely update to 2.1.2 from 1.9.3. Ruby follows semver only since Major version 2. If there even have been some incompatibilities since 1.9.3 the probability is very little, that your app used this features. We could upgrade all of our apps from 1.9.x to the last 2.x.x without a single ruby code change

How to upgrade Rails app from 2.3.5 to 3.2.x?

I have Rails 2.3.5 app, I want to upgrade to 3.2.x. How do I upgrade to Rails 3.2.x?
Thanks
I definitely recommend installing the Rails upgrade gem (rails upgrade gem). It's proven for me to be incredibly useful as a starting point for listing and verifying all the required upgrades to get to Rails 3.0.
I would also recommend this ebook http://www.railsupgradehandbook.com/
Once you're at Rails 3.0, you'll need to migrate to the asset pipeline, this is another good starting point: http://railscasts.com/episodes/282-upgrading-to-rails-3-1
This won't be a simple task and you'll need to ensure that your code doesn't break at each step, but these are tools I've found were great to get the ball rolling.
Please refer the link, http://www.spritle.com/blogs/2013/02/08/upgrade-rails-2-application-to-rails-3/
It may helpful to you.

Is Rails 3.1 ready for production use?

From what I saw on their Github page, the Rails development team has been releasing Release Candidate versions since May, and the most recent tag is v3.1.0.rc6.
I found many comments on Google about new features, but almost no critiques or experience tails.
So, are you using Rails 3.1 already? If so, in production environments? And also, what has been your experience? Are there any gems that absolutely won't work with Rails 3.1?
I appreciate any comments/opinions!
Here is git issues for Rails 3.1: Rails 3.1 issues
you can check that it near to final realease :). As for me I use Rails 3.1 in my work. And we have some projects already in production mode. As for gems, so I havent met gems that do not completely work with Rails 3.1. But anyway you should use most fresh version of your favourite gems or use completely new ones. So have a try on Rails 3.1 - it is stable and have many awesome new features.

Would there be compatibility issues upgrading rails 2 to rails 3?

Im considering upgrading a rails 2 app to rails 3 for a number of reasons (rails 3 features, certain plugins require rails 3 etc.)
Obviously ill have to update/grade some of the plugins as well. But concerning the code itself, should there be any compatibility issues when upgrading to 3? I know rails 3 changes a lot of helpers and syntax to make things easier, but do the older and more complicated ways still work (ex. gems in envioronment.rb, not Gemfile).
Also, anyone know a good tutorial on how to do it?
I have written a blogpost about it, where I point to the standard resources, but also handle some more deeper problems I encountered.
Hope this helps.
You may try this plugin to check your application compatibility in Rails 3. https://github.com/rails/rails_upgrade
If you want to upgrade from Rails 2 to Rails 3, first make sure to upgrade to the latest 2.3 version.
Then, before migrating, there is a list of changes you can make to make your Rails 2.3 application behaving like a Rails 3 application. Once you applied these changes, chances are the number of issues will be smaller and you can upgrade to Rails 3.
Once you installed Rails 3, use the rails_upgrade plugin to check the incompatibilities and fix them.

Rails 2.3.11 Administrator Gem

This is my first question here in StackOverflow :)
I've been searching for the best plugin for administrator for my Rails 2.3.11 app.
I can create my own but I have to rush my project so I decided to use these kinds of plugin.
I already searched rails_admin and active_admin. There are both good but I think that's for Rails 3 only. So I need to find some admin plugins for Rails 2.3.11.
Your ideas are much welcome :) Thanks!
Give Typus a try. It works on rails 2.3 and is quite popular, although the author isn't planning on maintaining the 2.3 version anymore.
https://github.com/typus/typus/wiki/requirements

Resources