Developing in Ruby on Windows

Developing in Ruby on Windows

Ruby and Rails

  • RubyInstaller for Windows
  • RubyStack installer for Windows
  • Rails

Development Environment

IDEs

  • RubyMine
  • NetBeans
  • Aptana RadRails

Text Editors

  • Sublime Text 2
  • e (aka TextMate for Windows) (seems to have been abandoned)
  • Vim/Ruby

bash Environment

  • Cygwin

Source Control

  • Git

Helpful Links

  • Setting Up Rails Development Environment on Windows XP
  • RubyonWindows Blog
  • Is Windows a First Class Platform for Ruby?

Related Questions

  • Why is ruby so much slower on windows?
  • Limitations in running Ruby/Rails on windows
  • Will using an IDE with Rails hinder me?
  • GUI editor for Ruby in Windows
  • What IDE / Editor do you use for Ruby on Windows?
  • https://stackoverflow.com/questions/826164/a-definitive-list-of-ides-for-ruby-on-rails
  • Ruby On Rails with Windows Vista - Best Setup?
  • https://stackoverflow.com/search?q=ruby+on+windows

Can Ruby be used to develop simple Windows applications?

Ruby is not primarily a web programming language even though Ruby on Rails is certainly suited for web development. Ruby is a general purpose scripting language.

The FXRuby and WxRuby frameworks are the most fully featured GUI frameworks for Ruby. You can write the apps in Ruby and then generate a Windows executable. The frameworks are cross-platform, so you could also run the apps written in these on other platforms, like Linux or Mac OS X.

There are also a few other less popular approaches like QtRuby and Shoes, and you can even use IronRuby (a CLR Ruby implementation) to write a .Net application.

Developing Ruby and Rails in Windows? Or Linux VM

You should also checkout the vagrant project which creates headless (non-gui) VMs and makes it easier to work with your files, etc in Windows while the code actually gets run on the Vagrant VM. Also, since its headless, the graphical UI isn't eating up resources and has less impact on your host machine.

Check out these resources:

http://www.vagrantup.com/

http://blog.dcxn.com/2013/07/12/introduction-to-vagrant-for-rails-developers/

http://railscasts.com/episodes/292-virtual-machines-with-vagrant

*Also if you're learning Rails, you MUST checkout Railscasts http://railscasts.com/

Ruby on Rails development on windows

I've been developing a Rails website on Windows & Mac (depending on where I am at the time) for a few months now and, in general, I haven't run into to many problems. Here's what I know:

The new Ruby 1.9.3 installer for Windows is nice because it comes with RubyGems (which a vague memory tells me was difficult before). That's what I'm using. I haven't been able to get the ruby-debug19 gem to install correctly on windows. So, I just comment that out in my Gemfile on my Windows computer. Other than that, I haven't had any issues.

With that said, however, I love developing on my Mac so much more than I do on Windows. I haven't found an editor that I love for Rails development on Windows (currently using Sublime 2 or Notepad++ with Explorer plugin), using Git is not as nice on Windows, and I just really don't like the Windows Command Prompt (I know there are other options, but still).

What IDE to use for developing in Ruby on Rails on Windows?

Try both NetBeans and RadRails for maybe a week each, then you can find which works best for you. The best advice is to learn your tool. If you are not checking out something new about your editor, something that could potentially save you time (regexp, etc) then you are doing yourself a huge disservice.

I have been using Eclipse/Aptana/RadRails and unlike Gaius have been pretty happy with it.
I recommend the Eclipse IDE for Java Developers from Eclipse Downloads: http://www.eclipse.org/downloads/

Then grab Aptana Studio, following these instructions.

When Eclipse restarts Aptana will have a view, click on rad rails and you are good to go. Just make sure you have ruby installed already, or it becomes a pain to resolve.

What do these RubyInstaller 2.4 components do?

The components are defined here. The single options do:

  1. Download, verify and run the MSYS2-installer. This installs the base MSYS2 environment (bash, pacman, tar, etc.) without development packages.
  2. Download the pacman repository inventory. This retrieves version information about all available MSYS2+MINGW packages.
  3. Download and install the development packages, which are typically required to compile ruby C extensions.

You should usually just press enter and execute all three options. And if something fails, you can restart the MSYS2 installation anytime later per ridk install.

My aim is to add some more component install options in the future. For instance to install bundler or rails or some other popular gems or extensions subsequent to the base ruby installation.

You don't need to install the previous DevKit. MSYS2 replaces the DevKit starting with RubyInstaller-2.4.

Since MSYS2 has much more packages available then the old DevKit, it also makes installations of many source gems possible. While previously any dependent libraries needed to be shipped as source tar or as "fat binary gem" (like nokogiri), now dependent native libraries can easily installed per pacman, similar to apt-get on Debian/Ubuntu. This is a big advantage of MSYS2 compared to the DevKit. The other advantage is that the programs and libraries are more up-to-date and actively maintained.

Use windows or linux to start work with Ruby On Rails?

If your current dev machine is running Windows, and you don't have access to a Linux environment right now, don't let that stop you from getting started with Rails. Definitely, definitely, definitely install the DevKit first thing (if it's not included in RubyInstaller yet). See https://github.com/oneclick/rubyinstaller/wiki/Development-Kit for that.

If you get deep into Rails development, or even start doing it for a living, you will inevitably drift towards using Linux on your dev machine. The problem is not Rails, but the many binary gems which are difficult or impossible to install on Windows.

The most popular Ruby library for manipulating images (ie. generating thumbnails) is RMagick, but trying to install it on Windows is enough to make a strong man cry. Paperclip is very nice for dealing with images and other attachments, but it is also a problem. Then there is a popular JSON parsing library which is also problematic on Windows. Unicorn (a popular Rails server) won't run at all on Windows, and Thin (my favorite) may also give you headaches. And so on, and so on.

You can get pretty far with Rails development on Windows these days, but at times you will find yourself having to test code on a remote server, rather than locally, and it can waste a lot of time.

Is Ruby on Rails windows development considered safe now?

It is still a pain to run RoR on windows. I strongly disadvise its use.

Few reasons:

  1. Installing Ruby is still a pain
  2. Installing Ruby on Rails is still a pain
  3. Most of the Ruby gems are not compatible

I'm trying to keep objective, but there's this is the truth unfortunately.

I strongly advise you to use a VM running Linux Mint ;)

ruby development environment

I strongly advise you don't develop on Windows. Why? First, there are a lot of things that break on Windows with every upgrade and the majority of gem or plugin creators don't use windows so they don't care about windows and don't run tests on it(there are several big name people who have flat out said that windows is NOT their problem it's yours). You'll find the *nix vs Windows problems will bite you in the ass again and again. Pathnames slashes, minor differences in ssh implementations, console and font problems, rubygems, capistrano, etc...

What will end up happening after a while is that you will always have this voice in the back of your head every time you have to debug something saying "Is this a problem only on Windows?" and that little voice is a cost to you..using up some of your battery every single day.

Macs are more expensive in terms of upfront dollars (which sadly I don't have) and linux platforms are more expensive terms of spending a day or two trying to get your wireless to work but those are upfront one time costs. The nagging insecurity of using Windows for Rails development is an ongoing cost. At least until the community starts rejecting things that are not truly cross platform.

As an example look at cucumber. For some reason a test framework is dependent on a particular console configuration not available in windows. So to use it in Windows you have to change the font in your console and change the code page in your console. Otherwise the letter "a" disappears from all the output. Why? Because it works fine for *nix systems and gives you pretty colours (I think this is a huge flaw and very very poor design choice even if you ignore windows).

You'll also feel like the guy who farted in the elevator every time you bring up a windows issue.

I say all this as some who has to use windows for his development platform at the moment. Hey, what's that smell?

[late edit: Ruby is also about 3 times slower on windows. This will impact your willingness run your tests all the time and hurt your TDD feedback cycle]



Related Topics



Leave a reply



Submit