Ruby on Rails for Windows

Ruby is multiplatform language. But not all OS suit it good enough. Especially, Windows
21 June 2017   4150

Traditionally, it is customary to work with Ruby on Linux or Mac OS. But sometimes it becomes necessary to develop Ruby on Rails on Windows. For example, in a situation where there is no computer with a more suitable OS at hand, and there is no desire or opportunity to raise a virtual machine. Let's see how well Ruby feels in the operating system from Microsoft.

Ruby

A dynamic, open source programming language, focused on simplicity and productivity
 

Ruby on Rails

Ruby on Rails (RoR) - a framework written in the Ruby programming language

Is it possible to install Ruby on Rails on Windows?

Yes. You can run a full-fledged server for RoR windows development. The easiest way to do this is to use the RailsInstaller utility, which also includes support for the Ruby on Rails framework. After downloading the application, just run the .exe file and follow the installer's instructions. Any version of Windows is supported, starting with XP.

For those, who would like to control the Ruby installation process on Windows, there is an opportunity to install all necessary modules. Process looks like this:

  1. Download and unpack Ruby from here;
  2. Install Development Kit;
  3. Unpack SQlite to Ruby directory;
  4. Install SqLite and necessary gems and frameworks using Ruby's Comand Prompt.

rubyinstaller
RubyIntaller webpage

Rubyinstaller is made for Windows 7 and upper, his workability under Windows XP, Windows Server, Windows 2000, Windows NT, Windows Vista, Windows 98 and older isn't guaranteed.

What problems can appear while running Ruby on Rails on Windows?

As a rule, these type of instructions finishes with the worlds: “Now Ruby for windows is ready to work” but not in this case. Installation is the smallest issue that you will face. You will also have to deal with:

  • Wrong time format. Due this issue, errors with gems installation can appear, even with Ruby on Rails framework. In order to fix this issue, you have to change all time formats in "specification" directory to s.date = %q{2017-01-01}.
  • Issue with gems launch, such as Nokogiri, Devise, Selenium-webdriver. Sometimes they just dont work with Windows and it’s hard to find the cause of the problem because there’s no info in documentation. Sometimes it is impossible to fix such bugs.
  • Slow interpreter. For example, if Guard is used as a command line, standard test can take more than a minute.
  • Many popular Ruby web-servers aren't supported for Windows.

Due to all these issues, there aren’t many Windows Ruby developers. That’s why the gem developers don’t test their products on Windows or just don’t bother about it’s workability on Windows. So, there is no need to wait when Windows will become more friendly with Ruby.

Running Ruby or Ruby on Rails on Windows is a difficult task without any final profit. Most of Ruby features wont run in Windows. a beginner can find large amount of learning courses with in-browser coding, so even for a first steps in Ruby, windows is a bad choice. As for me, I’ve started learning Ruby on Linux.
 

Andrey Axenov
Evrone Back End developer

Ruby IDE for Windows

Most of the standard text editors work great with Ruby on Windows. But, if you need a Ruby on Rails Windows IDE, the choice is not very big.

RubyMine. Specialized development environment from JetBrains. It works with any windows version, starting from xp, including 64-bit systems; supports all popular Ruby frameworks, project creation and management, great code integration with autocompletion and fast navigation. Also, application can be used for other programming languages, such as: JavaScript, HTML, CSS.

Disadvantage - high price with the need of prolongation for every year.

NetBeans. Free IDE, supports Windows Vista and higher, including 64-bit systems, but doesn’t support Windows 10. Besides Ruby, HTML, CSS, PHP, Java, C, C++ are also supported.

Features:

  • Debugging tools that monitor the performance speed of the application in the real time and factors, that influence it.

  • Ability to create own plugins easily.

  • Ability to deploy created projects outside the IDE.

Komodo. Environment supports Windows 7 and higher, also including Windows Server 2008 and higher. Powerful development tool that fully supports more than 100 programming languages. Popular bug tracker services, Ruby frameworks, code debugging, simultaneous work with several projects are also supported. But, universality has high price.

My friend recently started to learn Ruby on Rails, I’m his mentor. He had a big drama trying to install Ruby on Rails on windows, without any luck. There are many jokes in developers community regarding Rails and Windows connectivity. I would recommend for every Ruby newbie to learn it straight on Linux or Mac os.
 

Dmitry Karpunin
Chief Front-End Developer at Evrone

When it is necessary to run Ruby on Rails on Windows?

If you have an opportunity - don’t do that. If you'll run Ruby on Rails for Windows, sooner or later you will face insoluble problems that will slow down your development or even make it impossible. If you are able to work with this programming language on Linux or Mac OS, that’s the thing you have to do.

So when it is necessary to run Ruby on Rails on Windows?

  1. You don’t have proper equipment by the hand, but you gotta code right now. For example, your PC is broken, and the only left computer is very old and it cannot support virtual machine. But even in this situation you can use Engine Yard or Cloud9 as an option.
    Feel free to learn more about the best Ruby IDEs
  2. You would like just to test Ruby. For example, you’ve started to learn this programming language recently. You can make first steps in Windows. if you don’t need gem support, clean Ruby on Rails for Windows works great.
    Here you can have more info about learning Ruby on Rails and Ruby on Rails guides.

In all other cases, Ruby on Rails development on Windows will bring more issues than profit.

Are you working with Rails on Windows?

Are you ready to work with Ruby on Rails using Windows operating system despite all its abovementioned disadvantages? Or you are using another OS for Ruby on Rails development? Please, share your thoughts with the community. Also, after the voting, you will be able to see what people like the most.

RubyMine 2018.2 to be Released

Great news for Ruby developers - new version of popular IDE available now
27 July 2018   191

Major summer update of the integrated development environment RubyMine from JetBrains under the number 2018.2 released. Among the innovations - improving the work with the code, support for new version managers, re-testing only for failed tests and much more.

Code analysis

The new version of IDE has received an improved type inference that allows to better read the types of elements in blocks, arrays and hashes. This feature improves code autocompletion and navigation throughout the project:

Element CompletionElement Completion

In addition, RubyMine now correctly recognizes models using polymorphic associations, and offers them full support for "smart" functions.

Version Managers

The updated development environment now supports chruby and asdf. Moreover, now all version managers are available in WSL, Docker, SSH and other remote connections.

Testing

RubyMine 2018.2 allows you to retest only those tests that have not been tested. According to the developers, this frees the user from manually viewing each failed check. The new function also works with the rake test and rake spec presets:

Rerun Failed Tests
Rerun Failed Tests

YAML

In this update, developers paid attention to the YAML data serialization format. Now its code can be formatted directly in the IDE and use all the functions of autocomplete and navigation by code. Moreover, the new version of RubyMine provides automatic filling of YAML data structures that have JSON Schema files, and the ability to copy / paste the key path to the value in .yml files.

Git

Support for version control in RubyMine 2018.2 has received several new features:

  • files with a merge conflict are now grouped in a separate node;
  • a new action Browse Repository at Revision allows you to examine the state of the repository after each revision;
  • It was possible to skip the Push action during the Commit and Push command or use it only for protected branches;
  • you can connect an unlimited number of accounts to GitHub and select the main one for each project.

Other improvements

In addition to general performance improvements, the new version of IDE brought new icons, a dark theme for MacOS, support for the Touch Bar, improved support for JS, TypeScript and CoffeeScript, which you can see in the overview of the WebStorm 2018.2 IDE update, and connect the debugger to remote processes without having to reboot .