It’s officially here! You know about it right? The Ruby on Rails 5? After weeks of discussion and three beta releases, this would be a major release from Ruby on Rails community since June 2013. The Ruby on Rails 5 is been officially announced on 2nd September 2016.
It’s pretty exciting for mostly two reasons. The first is, we’ve already started implementing its feature on our native platform. Secondly, it’s being said that Ruby on Rails 5 is not only loaded with interesting new features, but it’s all set with a new framework to evolve the future of technology.
- No Clue About Ruby on Rails?
Well, if you are new to Ruby on Rails, then let me state the basics first!
It’s a web development framework that is in the market for more than 10 years. Many big brands like Airbnb, Hulu, and Github use it to run their websites. However, the interesting part about Ruby on Rails is, it’s not only fun to use, but it has a framework that is quick to learn and includes several important features which developers need to build web apps.
All in all, it’s a power-packed web framework, which can handle a number of tasks at any given time.
- Awesome! But How Does Rails 5 Stand Out?
There are a couple of interesting changes in Ruby on Rails 5. But, the shorter version is, it includes Real-Time data with Action Cable. The star Action Cable has added many real-time features right out of the box. Wondering what? For instance, if you’d ask an experienced web developer in past about which framework to use for a web app, most of them would suggest SocketIO or NodeJS. And the reason behind it is, these frameworks allowed you to add a number of real-time features to your web app.
However, that’s not the case anymore after the release of Ruby on Rails 5!
The new Action Cable leverages Web sockets that allow the developer to keep open connections between server and user’s computer. And because of this, you can now send data from your server to all your connected users and update everything they see in their browser. Pretty cool, right?
- The Main Point: How to Upgrade to Rails 5?
Whether you’re upgrading an existing web app or starting a new Rails 5 app from scratch, the Rails Guides Website is the perfect place to look for instructions. But, if you’d like to start right away, there are only a handful of commands you need to run for updating to Ruby on Rails 5. And, if you already have an RVM, then you’re lucky because you have to follow only a few steps to upgrade your local Rail version.
➔Initially, you’ve to update the Ruby, the gem’s manager, and gems that you’ve installed. To know which version of Ruby is installed currently, just type rvm list in your terminal. The same thing applies to gems. Type gem list in the terminal and you’ll have the information of all gems you’ve installed.
➔Now, let’s start installing Ruby on Rails 5. Type rvm install — latest in your terminal.
➔The above command will use Ruby Version Manager to download the latest and most stable version of Ruby. Once the download is finished, type rvm — default use 2.3.0 to turn the latest version as a default Ruby version.
➔After installing the latest version of Ruby, type gem list again in a terminal. Here, you’ll notice a shorter list of gems than before. Don’t worry, just type rvm gemset copy 2.2.2 2.3.0.
Note: replace 2.2.2 with your previous version and 2.3.0 with the latest version that you just installed. Updating gem list might take a couple of minutes, so hold your horses!
➔Once you’ve updated both, the Ruby 5 and gem list, the next step is to update gem manager. Type gem update — the system in the terminal.
➔Last step would be updating the gems. Run gem update to update all the gems in your gem list. Remember that it must include Rails as well. Type rails – v for the same.
And you’re good to go! You can now develop your next Rail web app on Ruby 5.
The new Ruby on Rails 5 is perfect for both, beginners as well as professional developers. It has introduced many extraordinary features that offer various new opportunities for building more type of apps on Ruby on Rails.
Additionally, you no longer have to make compromises and think about different frameworks because the new Rails 5 includes all real-time features and provides the ability to build API-only apps. So, the bottom line is, with Ruby on Rails 5, you can develop modern and real-time apps with short development time and simplicity in code.