How to Install Older Versions of Ruby on Rails (like 5 or 6)?  [Solved]

Message
Author
User avatar
rails123
Posts: 4
Joined: Tue Jun 10, 2025 7:43 pm

How to Install Older Versions of Ruby on Rails (like 5 or 6)?

#1 Post by rails123 »

Hello everyone,

I’ve been struggling for the past two days trying to set up an older version of Ruby on Rails.
I’m currently learning Rails through a course that focuses on versions 5 and 6, but the latest version available now is Rails 8. I want to start from version 5 and gradually move up.

I tried installing Rails 6 using rbenv, but I keep running into dependency conflicts even though the environment should be isolated.

I also tried using Docker (my experience with it is still basic), but even with help from ChatGPT, DeepSeek, and Gemini, I couldn’t get a working environment for Rails 6. Again, I faced the same dependency issues.

If anyone has a working, tested method for installing Rails 5 or 6 especially something simple and clear I’d really appreciate your help.

I’m using MX Linux 23.

Thanks in advance!

User avatar
rails123
Posts: 4
Joined: Tue Jun 10, 2025 7:43 pm

Re: How to Install Older Versions of Ruby on Rails (like 5 or 6)?  [Solved]

#2 Post by rails123 »

After many attempts, I finally discovered that the issue was actually within Rails itself. I kept encountering the following error:

Code: Select all

uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
To fix it, I manually edited the following file:

Code: Select all

~/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb
At the top of the file, I added this line:

Code: Select all

require 'logger'
Here’s a quick summary of the installation steps I followed using rbenv:
Install Ruby 2.7.6
Run:

Code: Select all

gem install rails -v 6.1.7.10
bundle install
bundle exec rails new . --force
rails server
That’s pretty much what I did—and the project is now working!
Thanks, everyone!

User avatar
CharlesV
Administrator
Posts: 7981
Joined: Sun Jul 07, 2019 5:11 pm

Re: How to Install Older Versions of Ruby on Rails (like 5 or 6)?

#3 Post by CharlesV »

Welcome in! and glad to hear you have it resolved.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
operadude
Posts: 1041
Joined: Tue Nov 05, 2019 12:08 am

Re: How to Install Older Versions of Ruby on Rails (like 5 or 6)?

#4 Post by operadude »

@rails123 :number1:

Good for you, and thanks for documenting your process :exclamation:

That will help folks like me :cool:

"Oh, and just one more thing...":

:welcome:

User avatar
rails123
Posts: 4
Joined: Tue Jun 10, 2025 7:43 pm

Re: How to Install Older Versions of Ruby on Rails (like 5 or 6)?

#5 Post by rails123 »

Thank you both, @CharlesV and @operadude, for the warm welcome and kind words! :happy:

I'm really glad to hear that sharing my steps might be helpful to others that’s exactly the kind of spirit I love in a community like this.
Looking forward to learning more and contributing where I can!

Cheers!

Post Reply

Return to “Chat”