Ruby versions and rails version on site5 is old - ruby-on-rails

I m working on a project which was developed by another developer. Right now my job is to fix the bugs and all the necessary things. After all those things successfully done when i started to work for deployment on site5.com i got to know here that they ve not upgraded the ruby version. Still they are using ruby 1.8.7. There is a tutorial to upgrade the system to rails 3 but m not able to do that. The rails version installed on the server is 2.3.16.
When the code was given to me i bundle installed it with new version 1.9.3 and then i fixed few bugs which was a syntax error because of that syntax deprecation in 1.9.3. Now i ve asked to the client that there may be some compatibility issues if i go with the installation. Now what should i do? Should i go with the installation or suggest him some other hosting website.

since phusion 4 is stable now (allowing multiple rubies), and ruby 1.8 is considered 'legacy' by phusion developers (see their blog), doing any fixes for ruby 1.8.x seems to be a waste of time.
Changing ruby version requirements would break the application on site5, if they're really still on 1.8.x .

Related

How to upgrade big Ruby on Rails project from Rails version 4.2.2 to 6.0.2.2?

I have a huge rails web application with wide user base which runs on Rails 4.2.2 and Ruby 2.2.2 as of now. I simply want to upgrade the whole application to the latest version of Ruby i.e. 2.5.0 and Rails 6.0.2.2.
The reason for upgrade being I want to integrate a completely separate React.js frontend and a separate Rails backend. Other reasons for upgradation being deprecating older version of gems and rails.
I have tried researching a lot for this. I have also tried the : https://guides.rubyonrails.org/upgrading_ruby_on_rails.html guides. But everything out there is so vague and haphazard. I havent found any clear cut method until now following which I can upgrade my rails application smoothly.
Please help.
What i would recommend you to do is to upgrade to Rails 5.x.x first and than to 6.x.x you can use those guides and follow step by step:
https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-4-2-to-5-0.html
https://selleo.com/blog/how-to-upgrade-to-rails-6
I would recommend a progressive update for both Ruby and Rails. I would for example start by updating Ruby from 2.2.2 to 2.3, using the Release notes as guide of what things have changed:
https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released
Once that work (which would be easy to check if you have high test coverage), I would continue with Ruby 2.4 and so on.
Ruby minor releases (for example 2.2.2 to 2.2.3) shouldn't include breakable changes, so you can just go from 2.2.2 to 2.3, 2.4, 2.5 ...
Also, note that the last version Ruby is 2.7.1 and not 2.5.0. Another good reason to update your Ruby version is that it is not maintained any more and it does not receives security fixes. 2.5.8 is in security maintenance phase, which means that it won't be maintained anymore soon. You may want to update to at least Ruby 2.6.
Regarding Rails, you can find the release notes here: https://guides.rubyonrails.org/5_0_release_notes.html (just change the number in url to get the information of a different release).

What happen if i use ruby version 2.5.1 with rails version 2.3.18?

What happen if i use ruby version 2.5.1 with rails version 2.3.18 ?
I had rails application built on rails 2.3.18 and ruby 1.9.2p320,
I want to upgrade version of ruby only not the rails is it possible ?
What are the challenges i have to face with this ?
GitHub maintain a public fork that has branches for older Rails versions, with various changes, that they've been running over time. For some time, they were running older Rails releases on newer Ruby versions than they were originally supported on, so you might find some useful hints around what needs backporting there. They haven't used 2.3 for a few years now, though, so at best it will make less work.
In general, Ruby versions make few incompatible changes, but with a codebase the size and variety of Rails, most of those few changes do hit somewhere. This seems like a bad idea to me: any security fixes in newer Ruby versions, for example, will be vastly outweighed by the known vulnerabilities in such an old Rails release.
If you're doing this because your application uses the system Ruby and you're upgrading/replacing the OS, I would instead suggest using rbenv / chruby / ruby-build / ruby-install to install the old version for this app.
It should go without saying that running such an old Rails version is highly discouraged, and exposing it to the Internet is outright dangerous -- but I'll say it anyway.
Rails LTS apparently provides a service backporting security fixes to Rails 2.3, which may make it slightly safer. They also seem to currently support running Rails 2.3 with Ruby 2.3; while that's not 2.5, it might get you closer, or be good enough.

RubyMine 8 development not working. Keeps saying No Rails Found in SDK

Title kind of explains it. In both the Development Configuration and Preferences -> Languages -> Ruby SDK and Gems settings I have the correct Ruby version/Gemset selected. But it still just saying:
Error running Development: the_factory: [No Rails found in SDK]
I've used RubyMine on tons of projects and this has never given me a problem. But this is a new project, using Rails 5 and Ruby v2.3.0, and I just can't figure out what's going on here.
This is in Ruby SDK and Gems settings in RubyMine 8:
And this is my Development config:
Update
When I run rails server in my project folder, it works as expected.
Ok, so I checked it out a little on RubyMine help page and I found this magical phrase:
RubyMine supports Ruby versions 1.8.6 to 2.2
So I removed my rvm Ruby 2.3 version, installed Ruby 2.2.4, create a gemset with Rails 5. Then I assigned that gemset to my project and Voilá! It worked as expected.
Note: This answer my specific question at the date I write this. But this obviously is not a long term answer, so if you are a future boy/girl with this very same problem, first check if your RubyMine version support Ruby >v2.3 before remove your current Ruby version.
For me the solution was that I had several Rails gem versions installed in my project directory.
gem uninstall rails
was the way to go, removing any unwanted versions. Feels like a contradiction - but uninstalling Rails meant that RubyMine could find Rails.

manually compiling ruby 1.8.7 on ubuntu hardy

running two rails 2.3.8 apps on two virtual servers in ubuntu 8.04 with apache and passenger. the ruby version is 1.8.6
we are upgrading one of the apps to rails 3.0.4. my understanding is that we need ruby 1.8.7 to run the app. with this version of ubuntu we will need to compile ruby 1.8.7 manually.
never compiled manually before. if you know of any resources i should check out that would be great.
i have not been able to determine the version of passenger and am trying to make sure it will be compatible with rails 3.0.4. any suggestions?
the application we are leaving in 2.3.8 is our core business application and i need to make sure i don't mess it up.
Thanks!
Just use RVM. Almost everybody use it now.
Early Passenger versions for Apache had some bugs so my suggestion is to simply upgrade Passenger to the newest version.

Rails 3 (Ruby 1.9.2 vs 1.8.6) and (MRI vs REE vs JVM) -- comments/suggestions?

Looking to build a Rails 3 stack and trying to sort out Ruby versions.
I'm very interested in the concept of JVM, but not 100% sure if it even relates to Rails 3; meaning why not just do a deploy just for JVM if needed.
Then there's heroku saying there's a bug in Ruby 1.9.1, but they don't say what the bug is, if it's addressed by Ruby 1.9.2 -- or what will happen as a result of running Rails 3 on Ruby 1.8.6.
UPDATE: Found the bug heroku is indirectly linking to: "Note that Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails 3.0. Ruby Enterprise Edition have these fixed since release 1.8.7-2010.02 though. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults on Rails 3.0, so if you want to use Rails 3 with 1.9.x jump on 1.9.2 for smooth sailing."
Anyone have info/link on the subject?
Thanks!
If you're running on windows, my personal recommendation is go with JRuby. MRI (both 1.9.x and 1.8.x) has mountains of problems on windows, whether deploying to XP, Vista, or Windows 7. I don't develop on Windows often, but I do teach Rails classes, and that's my recommendation to Windows students now. Haven't had many issues with JRuby at all, aside from needing to use a different database driver (the jdbc gem versions). RVM doesn't work on windows, but you can use pik (https://github.com/vertiginous/pik) to achieve many of the same goals.
My advice is that if you're starting a new Rails 3 project you should definitely think about kicking it off using Ruby 1.9.2. Heroku supports multiple stacks with the default now being Bamboo (the one that supports 1.9.2 as well as REE). If you're worried about gem compatibility or something else then you can hedge your bets and use RVM and/or multiruby to run your test suite across multiple versions of ruby so you can deploy to either run time.
Personally I'm running a Rails 2 app on REE and a Rails 3 app on 1.9.2 and haven't had any problems.
If you're not deploying on Heroku and are setting up your own server then I would manage your Ruby versions using RVM on your production server so you can easily switch between versions if anything doesn't work.
In summary:
You can run Rails 2 and 3 apps on both REE and Ruby 1.9.2.

Resources