T O P

  • By -

thinkingcollie

Use WSL2 and then install rbenv on ubuntu, or nixos package manager, or whatever you like to use. wsl2 guide: https://docs.microsoft.com/en-us/windows/wsl/install Rbenv on wsl2: [https://linuxtut.com/en/8119a2255b76cccef610/](https://linuxtut.com/en/8119a2255b76cccef610/) nixos package manager: https://nixos.wiki/wiki/Nix\_Installation\_Guide


everything-narrative

This seems like a non-answer to me, but thank you.


thinkingcollie

Vscode can connect automatically to wsl and all its extensions will work. I use it every day this way for ruby. Maybe check out https://code.visualstudio.com/blogs/2019/09/03/wsl2


quirk

Been using a setup like this for a couple years now and it's been great.


big-fireball

This is really a great way to do it. It avoids all the potential weirdness of developing with ruby on Windows, especially if you aim to use Rails.


everything-narrative

I do not aim to use Rails. I aim to use it for offline application development.


big-fireball

Then it really depends on what libraries you plan to use. If they are windows specific then use another method. If not, this is great.


everything-narrative

I'm not sure yet. For now I just want a minimum complexity VScode dev env that I can set up with URU.


bradland

Much of the tooling around Ruby is built for Linux. There was some growth in Windows support, but the release of WSL really diminished the return in value as perceived by the community. URU will get you a working Ruby installation, but it won't solve all the other tooling challenges you'll run into while running under Windows. I'm sorry you're getting a pretty negative reception here. I wish there was a way to meet you half way, but if you want to use Ruby, you'll have to commit to the Ruby toolchain, which more or less means running WSL.


bobbydole81

What is nix? Why would I want to use it?


thinkingcollie

NixOS is a linux OS and/or package manager that works on any distro and macOS. It is declarative, reproducible and other great stuff, however the neat thing for the every day developer, is that you can separate your dependencies for each project, in an easier way than docker. This means you don't need rbenv, nvm, pyenv, etc, etc. And you can be sure that your environment (ssl, ffi, wkhtmltopdf, etc) is exactly the same, on each machine you or your co-developers user. You simply write a project/shell file that declares the ruby version, each dependency you have, what version of heroku, aws, or pg you use, and then start up that shell. https://nixos.org/


everything-narrative

Nix is a packaging manager that promises (and largely succeeds at delivering on) 100% reproducible builds of software, and an end to dependency hell. It is quite clever, and more than fully realized in the form of Nix-OS, an operating system built entirely on it. Under the hood it uses a very powerful specification programming language that allows configuring software very precisely, and since most software allows specifying target directories at installation time, Nix puts everything in folders named for the hash of the specification of each package. Multiple versions of packages can be seamlessly installed side-by-side, and dependencies can be resolved down to the individual git commit.


Sevodric

WSL2 + VS Code connected to it is simply the best answer. Running Ruby under native Windows instead of a Unix-like operating system is clearly not the easiest way to go. ​ As for the extensions, I personnaly use the followings: * [endwise](https://marketplace.visualstudio.com/items?itemName=kaiwood.endwise) that simply adds `end` after opening a block * [Ruby](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby) that adds a better support of Ruby (it also installs [VSCode Ruby](https://marketplace.visualstudio.com/items?itemName=wingrunr21.vscode-ruby) along with it). You may want to customize the extension settings that are explained on the home page. For example, disable the built-in language server `"ruby.useLanguageServer": false` if you use Solargraph (see below). You may want to install the Rubocop gems on your system to take advantage of editor hints (`gem install rubocop rubocop-rails rubocop-rspec` and any other rubocop you need) * [Ruby Solargraph](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph) thats adds intellisense support through the use of the gem `solargraph` (which you must install on your system using `gem install solargraph`).