A few days ago a stable version of Rails 5.0.0 was released! The latest version provides users with a lot new changes and improvements which help them build more stable and efficient application in Rails. Below there are a few of the most important things which each developer should know before they start working with RoR 5.
The first thing which you have to know is that Rails 5 requires min. 2.2.2 Ruby version. The main reason for this requirement is a fact that thanks to this compatability Ruby gives it all the advantages which are introduced in 2.2 version, especially changes in the garbage collection.
Another major change which is very noticeable is that all operation tasks like
test, etc. previously available in
railscommand now are reduced to one command – the
rails. This change is caused by misunderstandings which most of the new users meet when they start working with Rails. They were often confused by which command to use: rake or rails, to execute a particular task. Now, this problem is solved by reducing all tasks to one command.
One of the most interesting things which is introduced in RoR 5 is definitely Action Cable. AC is the interface for WebSocket protocol which provides a full-duplex communication channels over a single TCP connection. Thanks to that, Rails developers can build the application in a fast and easy way, and enable it to to send a real-time message to individually connected users or broadcast message to all.
In addition, Rails was also used to build API but applying external software. The newest update serves the purpose of creating API in Rails exclusively.
Besides significant changes, there are many smaller but also notable of which it is worth mentioning.
10% performance improvement made by Richard Schneeman. More details about changes are available in his pull request: link
Puma is now a default web server instead of Webrick
rails restartwhich is used to fast reboot application server.
Online enable/disable cache functionality using
rails dev:cachecommand in a development environment. Restart application is not longer required in compare to Rails 4.