

Ask HN: Should I learn Rails without a Mac? - prakster

I have zero programming experience. I have a HP Pavilion Laptop with Windows 8, and want to take one of the popular online Rails courses. I imagine the instructions, videos, screenshots etc will all be on Macs.<p>Am I unnecessarily creating additional barriers towards my goal? Should I just bite the bullet and purchase a Mac (which I can do in 3 months)? Learning how to navigate around a Mac will have its own learning curve too. Any advice will help.
======
simonw
It's absolutely worth learning to use Linux in a VM for this kind of
development work - you'll be deploying on Linux anyway, so it makes sense to
use that as your development environment as well.

Give VirtualBox a try - it's free.
[https://www.virtualbox.org/](https://www.virtualbox.org/)

Personally I like Ubuntu.

~~~
brudgers
With Windows 8 and a recent processor, Hyper-V makes way more sense. Virtual
Box only makes sense if the processor of the host doesn't support Hyper-V

[http://www.groovypost.com/howto/create-virtual-machine-
hyper...](http://www.groovypost.com/howto/create-virtual-machine-hyper-v-
windows-8/)

------
tryitnow
You're probably excited about learning rails - if so, just go ahead and jump
into it. Like right now, don't worry about anything else.

You'll soon realize the value of not using Windows. A big part of learning as
a newbie is to just try things out. Then you can understand in a very personal
way why everyone on HN is telling you to develop on a linux VM (or Mac when
you get it).

You'll also find out that "learning Rails" as someone with zero programming
experience really isn't about learning just Rails. It's going to be valuable
to learn the command line, git, heroku, etc.

A great resource for a complete newbie is the material from Coursera's
"Startup Engineering" class. There's a lot of business-y stuff in it (e.g.
market sizing) but you can just ignore that and follow the instructions they
give for setting up a decent dev environment and all the tools you'll need to
do basic work. The reason it's so great is that they really hold your hand
through setting up a lot of the background "infrastructural" stuff that
someone with zero programming experience might not be aware of.

~~~
cheald
I'd actually caution against this, as a Rails dev of 7 years who works on
Windows. Trying to follow even basic tutorials on Windows will get frustrating
quickly.

~~~
prakster
What are you cautioning me about, cheald? Can you clarify.

~~~
cheald
Don't just "dive in" on Windows. The frustration will drive you away from
learning Rails, just because it's such a miserable experience on Windows. Set
up a VM or use a VPS.

~~~
prakster
I understand. Thx!

------
bpatrianakos
The short answer is do it right now with whatever tools youve got and learn
what you need to learn to get a Rails app up and running.

Your OS doesn't matter so much when you're first starting out. It'll matter
later on when you get the hang of some more intermediate to advanced concepts.

My belief (and a question like this will solicit only beliefs from everyone
even if presented as facts) is that you probably want a Unix-like OS if you're
getting into any web development. The only exception to that rule is if you're
going to be primarily using Microsoft technologies like .NET, C#, IIS, or any
other number of MS technologies.

I'll give you a rundown of what I've found the best uses for each OS are. This
is coming from someone who prefers a Mac (used at home) and uses both Windows
and Linux at work. So I've got a lot of experience with all 3 and have used
them all for heavy web development projects.

Windows is just fine to start with. You have access to a lot of high level and
mainstream tools like code editors and graphics programs. If you're a point-
and-click kind of person you'll have no problem. Problems start to arise when
you need to set up a local dev environment that would resemble a test or prod
environment. You have to jump through hoops and install non-standard programs
to get things like Rubygems, and different Ruby versions running locally. It's
not difficult per se but you'll find out what I mean when I say its a hassle
if you use any other OS. Also, the command line is sorely lacking on Windows
and even tools like Cygwin leave something to be desired at times.

Macs are a great alternative to Windows and my Preferred OS for web
development. You get a beautiful interface that's relatively easy to switch
over to from Windows. You still get all the power of GUI tools plus the vast
majority of Unix-y tools under the hood. It's great for design (you can run
Photoshop and other great tools natively) and you get equal or better variety
of code editos like Wondows. Where the Mac really shines is once you start
playing with the terminal. You've got almost all of the Unix tools you'd have
in a prod environment installed by default and you can run things like RVM,
Rbenv, and server stacks like AMP (apache, MySQL, PHP) or Nginx instead of
Apache and generally just replicate a standard Ruby stack locally through the
command line like you would in Linux or with MAMP-style programs. It lacks a
decent package manager but tools like Homebrew take care of that for you.
Macs, to me, are like Linux distros with top notch desig tools (and minus the
freedom but I'm not speaking philosophically here).

Linux distros are very similar to OS X in a lot of ways but have extra Unix
tools pre installed that a Mac doesn't have (but can get). They're not always
the prettiest and its rare that a designer prefers them (I mention design
because for me its a standard part of development) but they're usually the
most powerful when it comes to the 3 main OSes out there today. By power I
don't mean speed and the ability of the software to take advantage of the
hardware. I mean it gives you powerful tools and an unspoken but understood
"Unix Way" of doing things. There is a bit of a learning curve however. A
local development environment on a Linux machine will most likely best mirror
anything you'd publish online.

I went from Windows to Mac to Linux when I was learning web development.
Windows let me jump right in with the real simple high level stuff but then
gave me trouble when it was time to get more advanced. My Macs let me get all
the way to an expert level and never got in my way. I was actually able to
learn a lot about how Linux works on a Mac and transfer those skills over so
when I got into Linux I was very comfortable. Linux taught me even more
valuable skills, many of which I brought back to the Mac.

In the end I chose Mac as my preference because for me its a great middle
ground between the absolute raw power of the Unix Way and its great GUI and
support for design tools. I could use Linux and Mac with about equal ease and
efficiency but Windows still cramps my style to this day no matter how much
effort I put into learning its tools or "way" of doing things.

My advice to you is to worry about this decision later. You probably don't
have enough experience to know what you're missing and what you'd prefer. And
before switching from Windows to anything else just try what's out there. Macs
always look great in theory but wonderful as they are they're not always for
everyone. (I do have a feeling you will make a switch one day to something
other than Windows no matter what - I say this because I've seen it many times
and its not common for a web developer to prefer Windows unless, like I
mentioned, you're using a primarily MS-based tech stack).

 _The views expressed herein are my own and not meant to start a religious war
over OS choice. To each his own and there aren 't any right answers._

~~~
cheald
> _It 'll matter later on when you get the hang of some more intermediate to
> advanced concepts._

Or when you want to install any gem with a C extension, like mysql2 or
nokogiri, which many tutorials will steer you towards in the first 30 seconds.

~~~
vinceguidry
Yes, Ruby is unbearably painful to use on Windows for this reason. Your dev
environment will be brittle and you'll have to spend lots of time dealing with
platform issues, which you won't find easy help for.

------
jiggy2011
There is a ruby installer for Windows
[http://rubyinstaller.org/](http://rubyinstaller.org/) , so you can just
install that and then do "gem install rails" from the command line.

I imagine this is good enough to get you started.

Once you are ready to move on and start developing on a unix system you can
install Vagrant which will give you disposable dev virtual machines running
Linux (which will likely be closer to a real deployment environment than a Mac
would be). [http://www.vagrantup.com/](http://www.vagrantup.com/)

Your other alternative is to install a full Linux distribution on your
computer. Honestly though you are best off using Vagrant in the long run
regardless of your primary OS simply to avoid various headaches. Probably even
if you use a Mac.

One of the biggest problems for newbies is that filenames in Linux are case
sensitive whereas on Mac/Windows they are not.

A Mac is by no means a prerequisite for using Rails. The screenshots might
look a little different , but in most cases the important parts will be
identical.

~~~
prakster
Thank you for the pointers.

------
stevepike
You want to do rails development on a nix system, which basically means Linux
or Mac. Developing on Windows will be frustrating: some gems won't work
(especially ones that call C code written for a nix environment), everything
will run slower, and many tutorials will be confusing.

If you're just setting out learning programming it's a very instructive
experience to set up a Linux environment anyway. With modern machines you can
"virtualize" an operating system -- basically running linux as a program
inside windows -- which gets rid of a bunch of the hassle involved in
maintaining a linux desktop. I'd start by installing Ubuntu desktop inside
Virtualbox and getting a rails environment set up there. This will give you a
much more frictionless rails experience and you'll get to learn a bit about
linux in the process.

You may end up buying a mac later on, but there's no reason to delay learning
about rails just because of it. Just get started with the Virtual machine,
learn a bit about linux, and go from there. Many professional rails developers
use linux VMs on their Macs anyway.

~~~
prakster
Makes sense. Thx.

------
hikari17
You could try the RailsInstaller
([http://www.railsinstaller.org/en](http://www.railsinstaller.org/en)) project
from Luis Lavena. I went from essentially zero webdev experience to completing
Michael Hartl's Rails Tutorial to building modest production applications in
Rails on my Windows 7 PC at work with RailsInstaller as my starting point. It
hasn't been problem-free, but I've been able to get great support through the
RailsInstaller Google group.

Full disclosure, though, I also have a Mac for personal use and I've
definitely found Rails development and deployment to be much easier on a
linux-like platform than a Windows one.

~~~
prakster
Michael Hartl had suggested to me that while it can be done on Windows, I'd
probably be more efficient with his tutorial if I get a Mac.

~~~
zachlatta
Honestly it shouldn't make too much of a difference. I've never used rails on
Windows myself, but I've heard it works alright. If you're really worried, I'd
install a Linux VM on your computer and work from there.

------
div
In a pinch, Windows will do, but your best option is probably to find a nice
Linux distro and get comfortable with that. It will allow you to follow along
with the command line, and when the time comes, it's an easy switch to a Mac.

~~~
prakster
I see. Just Wikipedia'ed it. Any particular one you can suggest which has easy
setup instructions?

~~~
BruceIV
Linux Mint, probably - it's got Ubuntu's hardware support and the out-of-the
box install has Flash, mp3 codecs, proprietary video drivers, and all the
other "non-free" software you generally expect on a consumer desktop.

If you're running in a VM, one of the lighter Ubuntu variants might be a good
choice as well - check out Lubuntu or Xubuntu.

That said, the Linux distro you choose doesn't matter a whole lot, they all
tend to be pretty equivalent (well, I'd avoid Gentoo and Arch unless you want
to learn a lot more than you'd planned on about building packages from
source).

~~~
prakster
I see. Thanks.

------
sergiotapia
Windows used to work when running Rails but then it broke again for some
reason. That's just the way it is with Rails, since very few people use it on
Windows, Windows bugs are taken care of extremely slowly.

So what I did when starting out was use Linux Mint on a virtual machine to
learn. It was a pain in the ass but it worked, the speed of the VM was
negligible but sometimes I wished I was on a real machine instead of a VM.

When I knew that I would be use Rails for the long-run I bought myself an iMac
and haven't looked back. Everything Rails-related runs beautifully because the
majority of Rails developer use Mac OSX. You got homebrew, rubymine,
sublimetext, the works. I love my dev machine and can't see myself using Linux
to develop things on again.

~~~
prakster
Your experience is the reason why I asked this question on this forum. Thanks
for sharing.

------
joshka
Probably the simplest approach that lets you do local dev is VirtualBox +
Vagrant + an Ubuntu box. This combination shouldn't take a great deal of time
to setup (10-20 minutes + download time), is pretty much zero cost and means
you can use the laptop that you currently have.

If you can do remote dev, then a cheap VPS might make sense, however this
means that you need to be learning somewhere with 'net access.

------
brudgers
Three months from now, you can be a bit knowledgeable in Rails or own a Mac.
Which is the better option depends on what you really want to do and how much
effort you want to put forth.

I second the idea of Linux, and suggest installing it in a VM under Windows 8.
And yes there:s a learning curve, but one driven by necessity and applicable
to the world of web applications of which Rails is a part.

Good luck.

~~~
prakster
Thanks. Any pointers / links for where I can go from here?

~~~
rooshdi
I recommend installing Ubuntu on a separate partition to avoid upgrading
issues later on:

[https://youtu.be/SKsIvLPqlrc](https://youtu.be/SKsIvLPqlrc)

Then completing this Rails tutorial:

[http://ruby.railstutorial.org](http://ruby.railstutorial.org)

Then expanding your knowledge with RailsCasts while developing your own web
application:

[http://railscasts.com](http://railscasts.com)

~~~
brudgers
I would run it in a VM not as a separate bootable partition and use Hyper-V to
create it.

[http://www.groovypost.com/howto/create-virtual-machine-
hyper...](http://www.groovypost.com/howto/create-virtual-machine-hyper-v-
windows-8/)

It's a lot easier just to dedicate one to school work and dispose of it when
done, or clone it another VM is needed.

That way Ubuntu is just another app.

------
harrytuttle
Don't buy a mac for this. It's an expensive way to solve the problem.

This will probably get me downvoted but:

Download a dodgy OSX VM and run it inside VMware.

Then contact whoever is issuing the course and explain to them that the course
should be OS neutral.

Either that or find another more friendly course.

~~~
prakster
Appreciate your feedback. They all say that their course is OS neutral, but
I've heard that once you're in it, you could get lost.

------
adyus
If you don't want to bother with VMs and other Windows workarounds, I can
suggest signing up for [http://action.io](http://action.io) and getting a
basic development server. You can then use PuTTY or their own web IDE to
connect to the machine and start developing.

------
rdouble
I'd suggest a VM with Samba mount and Sublime Text. I'd suggest this setup
even if you're using a Mac because then you can match your deployment
environment.

------
ibstudios
Get a vps. For 20-30 usd you have a machine on the internet to play with.

Yes, you are making barriers.

~~~
prakster
If VPS = Virtual Private Server, which one can you recommend?

~~~
danpalmer
I'd recommend Digital Ocean, I've been using them for about 5 months now and
they have been pretty good. Smooth running, fast machine, and they start at $5
a month (which is what I'm on). For Rails you might want to go for a $10 a
month one, but it won't matter too much.

Here's a (referral) link:
[https://www.digitalocean.com/?refcode=09e94b0118a3](https://www.digitalocean.com/?refcode=09e94b0118a3)

Although I have given my referral link, my recommendation holds whether you
choose to go for them or not.

~~~
prakster
Thank you for the link.

------
throwaway1979
Here is my suggestion: use virtualization software and run an ubuntu vm.
Deploy code to Heroku.

~~~
prakster
Yes; Heroku for sure.

~~~
danpalmer
Heroku is good for their free tier, but when it comes to production hosting I
think they are hugely overpriced. If you can manage to get a bit of experience
configuring a basic Linux server, using a VPS or dedicated hosting provider
will be considerably cheaper.

------
wildster
Sublime Text and Ubuntu is not a bad choice.

------
dylanhassinger
learn rails however you can, then do some freelance work and buy a Mac ASAP

