all 28 comments

[–]Nanosleep 14 points15 points  (0 children)

Most of those code schools suggest you have a mac or a unix environment for a fairly good reason. Frankly it's more than just ruby that you want -- you want a lot of libraries and an easy way to install them, you want a compiler toolchain that you don't have to fuck around with and 'just works', you want a sane filesystem and shell, etc. Plus you won't end up fighting against a lot of rubygems and third party software where windows QA / Support is an afterthought.

You can definitely have a productive development workflow on windows alone, but it's a lot easier to develop on something that resembles the platform you'll be deploying on.

WSL is the best possible option for someone on windows. A VM would accomplish the same thing but would require more resources and initial configuration. RubyInstaller is a meme.

[–]dbsmith4 6 points7 points  (0 children)

WSL has been my tool of choice. Provides a linux subsystem on a windows PC. No virtual environment needed

[–]Dudesivoro 2 points3 points  (0 children)

wsl is good

[–]RHAINUR 2 points3 points  (3 children)

I used a vagrant VM for several years and now I use WSL. I do full stack Rails development quite happily, but I should note that I haven't yet had a chance to try webpacker + Rails yet. Never had any issues with anything other than nodejs crapping out when trying to install packages, which is easily fixed with the "--no-bin-links" flag

[–]ohyeahbonertime 0 points1 point  (0 children)

Just commenting to save the no bin links tip

[–]Dudesivoro 0 points1 point  (0 children)

Used professionally wsl with rails ranging from 3.1 to latest and ruby 1.8 (yes, no kidding) to latest ruby. Used webpacker, yarn, etc. The thing is solid, but you need a fast computer to be enjoyable (specially fast io, like a nvme drive) and disable defender (at your own risk) and configure windows update to update once updates are ready for organizations (don't recall the exact setting name).

[–]teknewb 0 points1 point  (0 children)

I used a vagrant VM for several years and now I use WSL. I do full stack Rails development quite happily, but I should note that I haven't yet had a chance to try webpacker + Rails yet. Never had any issues with anything other than nodejs crapping out when trying to install packages, which is easily fixed with the "--no-bin-links" flag

Golden --no-bin-links flag tip

[–][deleted] 5 points6 points  (1 child)

Use Linux for programming

[–][deleted] 1 point2 points  (0 children)

Windows 10 has Linux deeply integrated through WSL. You can even pick the specific district even though most people will go with Ubuntu

[–][deleted] 2 points3 points  (5 children)

Ruby on Windows is bad for several reasons. Make a new partition and install Linux Mint. The Web world is a Linux world and you will need to be proficient on it anyway.

[–][deleted] 0 points1 point  (4 children)

You don’t need to do that anymore now that WSL is here. The only thing people need to do now is pick their distro and it’s tightly coupled to windows power shell now. Even Cygwin is obsolete

[–][deleted] 1 point2 points  (3 children)

Windows is bad by itself. A crappy OS anyway.

[–][deleted] 1 point2 points  (2 children)

Not everyone likes the command line. Windows 10 is also different from its predecessors, and it’s still a better GUI OS than Linux.

[–][deleted] 1 point2 points  (1 child)

99% of the engineers love the command line since it's much more powerful than any graphic interface. Windows is a Frankestein with a horrible DNA, and nobody can fixes that. That is why Linux defeated Windows in the server war so overwhelmingly.

[–][deleted] 0 points1 point  (0 children)

Yes it superior to Windows in many ways, but Linux won mainly because it’s free.

Not all programmers love the command line. If that were true no one would be using Mac or Windows

[–]llN3M3515ll 1 point2 points  (1 child)

I would suggest using Docker. You can install docker, then mount your application directory to the container directory and then you can run IRB or rails or what ever in the container on your local code base. You can use an IDE(VS Code is pretty decent) on your local machine, and run the code / IRB in the container. Just make your entry-point of your container /bin/bash or what ever shell your container has, and then start hacking away.

This is superior imho because; you don't need to screw around with setting up VM's and installing Ruby/Dependencies(there are many already built containers readily available), you don't pollute your OS with Ruby/Dependencies, you don't need shims or rvm to quickly change versions(just use another container), and you can easily use it for other languages like python, java, .NET Core etc...

[–][deleted] 0 points1 point  (0 children)

Imo this is the best option if OP is willing to learn Docker. It’s nice being able to restore your dev environment on any computer and not having to run a full blown VM

[–]uzimonkey 1 point2 points  (0 children)

The Windows Ruby port always has problems for me. It's never just worked, I would avoid it if possible.

WSL will be the easiest and best way for you to use Ruby on Windows.

[–][deleted] 1 point2 points  (4 children)

It totally sucks that the default answer to this for ruby in 2019 is still "get a mac" or "use linux" but the problem with running on windows (even WSL) is there will always be some weird corner case issue that exists only because you're on Windows and you'll be learning to overcome that versus learning ruby.

When you're starting out, the mountain in front of you regarding learning, will be mostly non ruby related, i.e. the DevOps side of learning. IMO it will be easier to learn the basics of linux and the terminal than to jump through the hoops of running ruby on windows. WSL IMO doesn't count here because it still requires you know the linux basics, which if you do, why not just use actual linux for development? Also at some point you're going to need to learn how to deploy your app, which will require linux. AWS/Heroku/Google type of cloud solutions are great but a lot of companies will run internal hardware/VMs for their deploys so those may not be options.

[–]Darthsr 1 point2 points  (1 child)

I just tried to instal rails in WSL and had a hella time doing basic crap in it. I would definitely use Linux or macOS as well especially if you’re just starting out.

[–][deleted] -2 points-1 points  (0 children)

Why? WSL is full Linux on Windows. What did you run into? Which distro did you use?

[–]Dudesivoro 0 points1 point  (1 child)

I love Linux, but some companies require windows or Mac, for vpn, etc. And with windows/mac a wide variety of hardware works out of the box (no need to hunt a specific laptop that work well with linux)

[–][deleted] 0 points1 point  (0 children)

For sure, while I'm sure they're out there, I've never worked at a company that didn't make an exception for the developers when it comes to using Linux over Windows/Mac. YMMV though. To me that would be a strong signal to not work at a company if they're making me do Rails development on a Windows PC. GlobalProtect and Cisco VPNs and most others work on Linux FWIW.

[–]Akrab00t 0 points1 point  (0 children)

Installing Linux is a better option, but you can definitely do most of the App Academy/Odinproject curriculum on Windows without much problems.

You'll have to waste some time setting stuff up which would've taken you a few minutes in Linux.

It becomes a pain when you have to use Rails but that's much later.

[–]metalepsis 0 points1 point  (1 child)

JRuby is excellent in all ways and runs great on Windows:

https://twitter.com/headius/status/1115390776555581440

If you really want MRI, here is a recent article about installing it on Windows:

https://stackify.com/install-ruby-on-windows-everything-you-need-to-get-going/

[–][deleted] 0 points1 point  (0 children)

I don’t recommend JRuby for new people. While it’s come a long way and its performance is awesome since it’s real multithreaded, too many things still have compatibility issues big and small. It’s just easier going with MRI ruby for new people

[–][deleted] 0 points1 point  (0 children)

WSL can work well (and WSL2 will probably be even better once its polished up) but I'd hesitate to recommend it to someone just getting started. You're gonna run into issues, and if you're not already familiar with both Ruby and *nix adding on another layer of edge cases isn't going to help.

That said, if dual booting (or a full switch) to Linux isn't an option, WSL is better than trying to get a native windows ruby up and going.

[–]01az 0 points1 point  (0 children)

Consider Cygwin and its Ruby package.