Downgrading Michael Hartl's Rails application to Rails 2 [closed] - ruby-on-rails

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I built (hacked) my web app by extending Michael Hartl's Rails 3 tutorial, only to discover that my web hosting service requires Rails 2.3.8. I am a complete newbie to Ruby/Rails, and was wondering how feasible a downgrade from Rails 3.x to Rails 2.x would be.
Unfortunately my webhost is not able to upgrade to Rails 3.
Edit
To be more specific: my application is largely based on the tutorial mentioned above. I am looking to determine what type of effort is involved in downgrading the Rails 3 tutorial application into a Rails 2 application. I will try it out anyway, but due to my inexperience with Ruby / Rails, before I started I just wanted to get an idea of what to expect (i.e., if there will be a lot of syntax changes, or will I have to restructure the file directory, etc.)

You do NOT want to do this, it's a really bad idea, You'll end up chasing your tail forever with weird error messages and when yuo ask about them you'll be a very unusual case.
Either
Find a host that support Rails 3, while you get ready for Rails 4 (tee-hee)
Seek out of of the (many) books on amazon or ebay that cater to rails 2 (still probably a majority at this point).
Use Heroku - many people are using Heroku to go live for free and then be low cost when more's needed.
The main thing here about rails is that the versions advance quickly - and the code structure changes a lot with each version. You have to work much harder to avoid technical debt than with other, more mature, technologies.

Agree with the 'new host' suggestions. I haven't downgraded an app, but the upgrades I've done have taken weeks on large apps. So my answer is that it's not feasible enough for me to want to try, and I've been using Rails for years.
I've had a cheap Dreamhost account for years, and they stay up to date. I've also heard good things about bluehost. Note that both of these shared providers are "get what you pay for," but if you value your time, it's certainly worth $7 or whatever the monthly fee is to not spend your time downgrading the app.

It can be done though if that's what you really want. But it is a lot of work. I remember upgrading one very large app from rails 2 to rails 3. You will need to do this reversely. I had to solve gem compatibility(some gems only work with rails 3 and it might be harder to get support for rails 2 now), active record had a different API in the past versions, I'm not even sure if there was the chaining feature. E.g. instead of Model.where, you would often write Model.find(:conditions => {...}), if you're using generic ajax helpers(with :remote => true) that appeared in rails 3, then these would not work. Plus I would also scan the rails changelog for any security patches that were done in rails 3 just to be sure. Could be that you will have to tighten security on some places on your own in the older version. If you have your app test covered (and I hope you do :-)) than there might be some problems with older versions of rspec or cucumber but generally these were not so big. I think gem compatibility is the greatest issue. The rest is more or less mechanical work. Find and replace.
Good luck with that but as was said before, if you can switch your hosting then I advise to do so and stick to the latest version of rails.

Related

Should I use Rails 3 or Rails 2.3.8

I heard Rails 3 is almost ready to be released from beta, meaning its a stable version. But of course the real date still unknown.
So I'm looking for advice from a good RoR developer. Do you think I should learn and use Rails 3 RC version or use Rails 2.3.8? If I use the RC version now will it be hard to upgrade to the stable Rails 3 version?
Is there a decent RoR developer out there than can offer some guidance?
Thanks.
I don't know what a rock developer (!) is, but I'd recommend going with Rails 3 rather than Rails 2.x. Rails 3 represents the future direction of Ruby on Rails, so it's worth getting up to speed with it as soon as you can. To be frank, Rails 2.x is now an evolutionary dead-end. There shouldn't be any significant changes between the Rails 3 Release Candidate and the final version.
The barriers to adopting Rails 3 you might encounter are:
its availability on your production stack
plugin/gem compatibility
For the first issue, I know that the popular Heroku for example are tracking the Rails 3 beta releases pretty closely. Regarding the second issue, not all plugins or gems are compatible at the moment, but a lot of the most popular ones are. If there are specific plugins or gems that you need to use then check here.
If you need to get a project off the ground now, then by all means go with Rails 2.3.8. It's the safe choice.
There are some significant changes in Rails 3. Some tools will be available to help you upgrade. But no automated tool will ever completely convert your 2.3.8 application to Rails 3. It's hard to tell how much effort is involved, that really depends on your application.
That said, if you are new, learning, and not expecting to release anything for several months, Rails 3 is the right choice. By the time your grok Rails and have something in production, Rails 3 will likely have stabilized, and nobody will be looking back.
Use rails 3!! The RC is still in the pipeline, but it's more or less good to go and you won't need to make any code changes when the final release is made
Here are some reasonable resources to get you started with it
http://railscasts.com
http://www.railsdispatch.com/
http://www.teachmetocode.com/
http://rubyonrails.org/screencasts/rails3/

best ruby on rails cms [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
i need to choose a cms for my next project, i have searched and come up with these 2 : radiant and refinery, which one is better for building middle size websites ?
are there any other options out there for rails cms ?
one important factor is that client can easily update their website without much knowledge
thnx for helping
I'm one of the developers of Refinery CMS and I would recommend it for the use you've described.
Refinery has been built over a period of 4 years where we have shown it to regular people and let them update their site without our help. We purposely leave out technical details from the UI so it is extremely straight forward for a non-technical client to use.
Which is who a CMS is supposed to be for, right?!
If you have a smaller site you need to build in the future, there is also a hosted version of Refinery called Refinery HQ which allows you to quickly and cheaply give your client an editable site using all the same tools the open source project offers.
I find that the field is still very fragmented. I've looked at Radiant, adva-cms, BrowserCMS, and Refinery over the last year. My simple take is this:
Radiant is the most mature, but takes over the whole application stack with its proprietary flavor. Adding your own application to it is not just like writing a Rails app, but you have to learn the Radiant extension way to do it. Rake tasks, test suites, migrations are all non-standard. This limits flexibility, and comes with much higher staff training requirements.
adva-cms is built as a Rails engine (ships as gem), and doesn't take over the application stack, so you can develop Rails applications as before and adva-cms coexists peacefully. It has nice support for interationalization and multi-site support. It's promising, and they just released adva-cms2, a complete rewrite targeting Rails 3. It's promising and yet very young.
BrowserCMS, like adva-cms, is a Rails engine and struck me as a tad more mature, when I first looked at it 9 months ago, but development appears to have slowed down. I chose it for a project earlier this year, but we're wondering what on-going developer activity will be like. As of this writing there is no Rails 3-compatible release yet.
RefineryCMS seems to have a lot of activity and commercial backing, but unlike the other 3 still has no test suite. A 4-year old project in Rails without test suite is too great of a risk. When it'll hit that exponential curve of increasing cost of change due to lacking regression is debatable, but whether it'll come is not. I'm also weary of developers in this day and age working in Rails who still don't understand TDD. Your mileage may vary.
All told, there is no one brain-dead simple option yet that fills most needs. Choose based on your needs.
Update 9/2011: We've recently been using the rails_admin gem which works wonderfully well, isn't very intrusive and allows for lots of customization. It's probably the new Rails 3 and after standard. There's also active_admin that follows a similar concept we've used on another project.
I really like RefineryCMS as it is flexible to use, does not deviate from Rails way of things, and is very extensible. Converting an existing Rails app to a Refinery app is a breeze. They do have a cucumber test suite with 46 odd scenarios, and you will have to decide its effectiveness.
On the other hand, Radiant is also very good, but it has a bigger learning curve as it is very extensive and proprietary in nature. Although the extension base for Radiant is huge, for adding new functionality, one has to rely on an existing extension or build one. It is hard to take an existing Rails app and convert it to a Radiant app.
Having contributed patches to Radiant in the past, and having used Refinery (though only briefly), I would lean towards Radiant. The plethora of extensions make it very easy to extend, and one of the planned features for 2.0 (as discussed on #RadiantCMS on Freenode) is to make the extensions a bit more Rails-friendly (Think Rails 3 Engines), so the problem of porting existing apps to extensions easily should be resolved after Rails 3 support is finalized. The current plan is to begin hacking on Rails 3 support in earnest after the 1.0 release.
Radiant 1.0.0.RC4 is currently very easy to install and use. There are great instructions for getting it setup and deployed on the GitHub Wiki, and the first full release of Radiant 1.0 should be any day now, so this is the perfect time to start using it or get involved with its development.
In my opinion, there is no finer CMS for small-medium sized teams (even with large teams, it can be made to scale fairly well, though I find this requires a tiny bit more work than the average user will be willing to put in).
EDIT: Also, Radiant 1.0 RC4 will run fine on Ruby versions 1.8.7 - 1.9.3. Just so you can make sure it fits in with your existing Ruby setup.

Rails 2.3.4 Vs Rails 3 + Book - Beginner in RoR

I have started with Ruby and Rails development and I am a Java developer from the last 2 years (student). I am in for two things:
Learn Ruby
Make my website on ROR
I have Agile Web Development with Rails, 2nd Edition.
So, here are my questions:
How is the Agile Web Development with Rails book to start with, where I don't know anything about Ruby and proficient with Java.
What is the difference between 2nd and 3rd edition? People say the changes are irrelevant for a starter, how far is that statement correct?
Should I start with Rails 2.3.4 or Rails 3 (around the corner)? Rails3 It Is!
The Agile book is good, but the 2nd edition is for Rails 1.2 - which is quite old now! You could buy the 3rd edition (which is for Rails 2), but with Rails 3 coming out soon that'll probably also be outdated soon.
My recommendation is the website: http://www.railstutorial.org/book
It's a really well written online book called 'Learning Rails by Example', it gives a thorough introduction to Rails (using the latest Rails 2.3.8). Two of my colleagues have used it recently to get into Rails.
As someone who went on the same path, from java to rails, recently, I'll give my two cents.
Start with whatever version you have book/tutorial/guide for. (assuming it's good book/tutorial/guide, of course) Unfortunately, backwards compatibility is a big problem for rails and I often saw that code examples created just 2-3 years ago need significant fixes to become workable now. And fixing them especially difficult if you're a greenhorn.
As for "Rails 3 is cooler" argument, you could skip it as well and wait for Rails 5. IMHO, if you're doing a website for fun/to learn, both second and third versions will give you basic understanding of the platform and language. And once you know it, 'upgrading' your knowledge to the next version is much simpler than learning it anew.
Good luck with your quest, you'll need a lot of it :)
I don't have the Agile Book, but I can answer question 3.
Firstly, I have no idea why you would start with 2.3.4 when theres 2.3.8 out already.
Secondly, I would might do a little testing and mess around a bit with 2.3.8, but not start anything big and wait for Rails 3. This is because Rails 3 is largely different but better and you will probably want to upgrade an application once it comes out. Hence, it would be smart to wait for Rails 3 to be released before starting any large projects so that you don't have to go through the trouble of upgrading.
As a bit of note on question 1, I have done fine learning without the Agile Book, but there are probably some thing I could pick up better with that book rather than looking things up on Google and the RDoc.

Is Rails-2.3 stable? Does anyone have any problems with it?

I want to develop an application in Ruby on Rails. I have used rails(vigorously) a couple of years ago. since then i haven't given it a try, i have been concentrating on core ruby. At that time, Rails(1.2.x) used to be a bit slow! so my problem is whether i should go for the earlier slower version or should i try newer versions... is it fast and STABLE? And does it have proper support for all the gems that were made for earlier versions?
Thanks
Compared to two years ago, you should be impressed with where Rails is at. Here are some things to take note of.
mongrel is still fine as a server, but many (most?) people are using Phusion Passenger. I'm running a few apps in production mode with Passenger, and it's great. It plugs into Apache with a very small and simple set of directives. You won't have to set up balancers or rewriters like you used to.
Phusion also offers RubyEE, which is their own, more efficient version of Ruby. The installer works in such a way that if you decide you don't like, it can be removed by simply deleting its directory. It's all self-contained.
rmagick is still just as awful to install as it ever was, but now there is Paperclip as an alternative.
You'll love how fast 2.3 loads the console.
named_scopes are a huge step forward. Be sure to read up on them.
There are dozens of other reasons to upgrade, most of which can be found on this site. Unless you have an axe to grind with Rails, I doubt that you'll be disappointed with it.
Now, when you ask about stability, the answer is "sure, it's stable." However, you gave no information regarding what types of user loads you're trying to support. More detailed questions could lead to more detailed answers.
Edit
Answering your comment.
10 Cool Things in Rails 2.3 by Luke Francl. This is a nice summary of the latest highlights.
No problems with Rails 2.3 yet! No Problems with gems as well! Give it a try, it rocks! ;)
2.3.4 is stable enough if you are running Ruby 1.8.6/7, not so much if you are running Ruby 1.9.1 (even though it should technically support it properly).
If you are going to run Ruby 1.9.1, good on you, the speed improvements are really good, however you will have to be aware that some things wont work as intended and will need some patching of either core Ruby or Rails.
Saying that I would still avoid REE. Anything that has malloc'd for me in development I wouldn't trust in production.

When will you upgrade your app to Rails 3? [closed]

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 11 years ago.
Now that the Rails 3 beta is here, let's take a little straw poll.
Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you're not planning on upgrading any time soon, tell us what's stopping you.
Honestly? When developers wake up and start work on Rails 3/Ruby 1.9 in their gems and plugins. They know it's been coming for several months now, and most haven't even bothered to upgrade. One in particular that I'd like to point out is authlogic, one of the most used authentication plugins out there. It still doesn't work for Rails 3.
Whoops!
I'm not planning to. I'm sure I'm in a very small minority, but my big application is still running 1.2.6. Each time I consider making the effort to upgrade it seems Rails changes again.
It does what I want it to do, makes good money, and despite feeling more and more left out in the cold I just don't have a sufficiently compelling reason to update it.
All my Rails apps are currently running under Rails 2.3.5 and every app has a LOC of 80% or greater. This has always been a key requirement for every product I create for myself or I manage at work.
Usually, upgrading to a minor/bugfix release is just a matter of a few minutes.
Change GEM version, upgrade requirements, run tests, fix issues and commit.
Rails 3.0 is a major rewrite and the biggest problem is represented by plugin compatibility.
Plugins are not under my direct control. This is the same reason why I had hard time trying to upgrade to Ruby 1.9.1.
However, I'm already playing with Rails 3. I want to learn the most important changes of Rails 3 as soon as possible in order to start moving the existing apps to the right directions. Moreover, as a plugin author, it's important to me to start working with Rails 3 in order to make my plugins compatible.
Yesterday I start with my most simple app. Well, at least this is what I was used to think about it. Anyway, it is the app with the lower number of external dependencies (less than 3 Gems) and it took about 1 hour to upgrade and 3 hour to figure out why Rails was failing to load my routes. It turned out, the Rails Metal component was fighting with the new Rails 3 stack.
There are some minor issues I have to figure out, but I can say I successfully migrated my first app to Rails 3.
I'm planning to migrate all my Rails apps to Rails 3 as soon as possible, once Rails 3 stable will be available. Or at least, as soon as I can figure out whether the dependencies actually work with Rails 3. Fortunately, a project has been started at http://railsplugins.org/ with the intent of listing all compatible/incompatible Rails plugins.
My remote environment is already compatible with Rails 3, I'm using Passenger with Ruby Enterprise Edition (1.8.7). The only blocking issue are plugins.
I guess it would take at least one month before having the major part of my Rails app ready for Rails 3 thought I won't probably start the upgrade until Rails 3 stable is out or I really need the new version for some blocking feature (ex. subdomain-based routing).
I'm not going to upgrade any apps to rails 3.
However, I just decided that all new projects will be rails3 going forward. The lack of plugin support isn't a big issue as I see it as an opportunity to decouple my apps from plugins so that I can swap them in and out as I please later.
I also suspect that the big plugins will upgrade very quickly as they won't want to be left in the dust.
Keep track of plugin status here.
I've been keeping my apps on the edge of 2.3, but since there's a lot of fundamental changes to Rails in 3, I'll probably install the beta, work on converting them over and hope to be ready by the time it's released as stable.
I'm also glad there's a lot of lead time before RailsConf so I can really get familiar with the new features of Rails 3 and won't feel lost/overwhelmed there.
I don't think I'll upgrade any of my applications. It would be a large amount of work compared to what I'd gain from it. Also in some cases the plugins/gems I used in my app are not compatible with Rails 3 so upgrading would be impossible or would require to fork the gems... too time consuming.
If I had to update, I'd probably wait a bit more for all the gems/plugins to be updated to Rails 3. Of course any new application I'll develop will be done using Rails 3.
I'll answer my own question.
I'm not sure how many betas there are going to be for Rails 3, but I'm going to hold off converting my blog application until the next beta or the final release. I think it's going to be quite a time-consuming process because I have a lot of view helpers that build markup, a lot of named scopes and some quite complicated routing.
I want to add page caching first before tackling Rails 3!
After trying out the beta and it not wanting to work with any commands, I have decided to wait until a new beta.
The ticket has already been opened for the issue.
After realising that I probably spend more time in Zend Framework and Doctrine getting code to work (fixing framework bugs, annoying language workarounds, and just plain pain), than actually coding features I decided that it's finally time to give RoR a go. Especially as RoR3 is now out with a bunch of documentation.
5 hours through and it's looking really promising. 1 hour of it was debugging though, some documentation on a plugin was not up to speed, but alas I'm there.
It's interesting, and does seem to be in a better direction. More time to code on features, and less time coding to debug.
So the app I'm converting is my premium CMS that is deployed in over 20 websites now, and powers my own balupton.com - so will be interesting, as the CMS is already a complete featured cms.

Resources