Using an Editor versus an IDE for learning Rails in 2023

Hi All,

I am considering diving into Ruby on Rails and would like some advice on what to use as my editor/ide to learn and be productive with my dive. I’m an experienced coder in many other languages. I would like to know what editor or ide y’all suggest for learning and editing ruby / ruby on rails code, in 2023? As a mixed language coder, I am not interested in becoming a hardcore ROR person, but just in picking it up and being able to build apps that work with it at say a prototype level or personal use level. I like fast editors that have syntax highlighting, some form of tab completion, and that are integrated with the windowing system of the OS, currently I use Kate, when I need something more than vi.

I’m currently running Linux Mint 21.2 “Victoria”, but I often run Mojave on my Mac Pro, and Windows only when absolutely, as a last, desperate, necessity (removing word metadata or Visual Studio or something).

Way back when, when I looked into this, a lot of rails devs were using Textmate (which is great, on OS X, but I need something on Linux). I see some folks using Sublime, which, out of the box anyway, appears to be similar to textmate, but with no easy quick file open feature like CMD-T. Anyway, I’m open to suggests as to what text editor/ide is a good option in the modern era!

Thanks,

Will

1 Like

currently I use Kate, when I need something more than vi

I’ve never used Kate so maybe way off base but but it’s odd for me to see some describe vi as not enough. :wink:

Probably most folks would recommend VSCode. If you don’t want it with the spyware, you can use the VSCodium version. Despite being an Electron app (which I normally detest) I do have to admit VSCode does perform very well. It’s a bit too kitchen sink for my tastes but for most folks it’s their preferred pick these days.

I’ve never used RubyMine, but a lot of folks I respect swear by it so if you want something Ruby-specific perhaps check that out. It it is commercial software. :frowning:

I personally use Textadept. It’s open source, cross platform, fast and very customizable. It’s is a bit more bare bones but it’s customization means you can build up to support the workflows you want. I’m naturally more of a “give me a base and I’ll build exactly what I want” vs a “give me a kitchen sink and I’ll dig through it to find what I want” so it fits my preference but I admit it’s probably not what most folks want. It is entirely customized via Lua but I see that as a plus as Lua is such a fun language and quick to learn.

2 Likes

Well, I guess I mean something more… gui integrated … than vi. I heart vi, but I also like visual editing - copying and pasting across docs in doc, etc. Sure, some vi guru has all this programmed into a keypress, but… OMG, please vi lovers, don’t flame me for it :).

If you like vi but want something more graphical perhaps check out neovim.

2 Likes

I experimented with TextMate, Sublime, and RubyMine, but for most of the last 8 years of ruby coding (and most of the last 25 in general) I’ve just used vim.

But I have to second VS Code as being the modern choice. I’m switching over to it. When you set up devcontainers they integrate pretty well with Docker to provide consistent multi-container environments.

And ruby has seen some cutting-edge language work that integrates well with VS Code. One extension can run Shopify’s LSP, another runs Standard or Rubocop, and your IDE stays up-to-the-second for linting, syntax errors, knows all your classes and methods, and can even run your test suite automatically. Syntax highlighting and tab completion are just the beginning.

1 Like

I like VS code for pandoc syntax markdown (really, can’t be beat). It’s ok for C#, webby stuff, and Python. I’m giving it a try with the shopify ruby package and it’s not been bad. My main issue is with the so-called integrated terminal. No matter how hard I try, I can’t seem to make it find my asdf version of ruby or read my .bashrc, or run a custom environment script, or… which makes it a cute terminal, but useless for real work. I tried it with rails new and it blew up with missing libraries, etc. Come to find out, it’s using a system version of ruby and not the one from ASDF that’s global. It just seems like a waste to load up VS and have to run a terminal on the side, when it supposedly has it built in. That said, JetBrains had the same kind of issues with its integrated terminal back when…

At the moment, I’m using Sublime, with Terminus. After a bit of a learning curve and figuring out what packages are actually useful, it’s pretty decent… haven’t run kate once since installing it, but I still have to use vi for quick edits, complex searches, and the like.

Well, apparently VS code has no problem with rbenv, so that’s gonna work. Yay! Wonder what’s up with asdf’s shims vs rbenv. Oh, well, I’m comfortable with rbenv, so no big whoop.

For nontrivial projects, I use a Dockerfile, docker-compose.yml, and devcontainers. When you do that the terminal is inside a container and you not only get the ruby version your Dockerfile specifies, you get the OS you chose and bundle set up the way you want.

It’s a bit of a PITA to get working, I will admit.

Yup, I very much second that. RubyMine if one’s willing to pay for probably the only palatable subscription based licence in this area of the universe or VSCodium / VSCode otherwise

3 Likes

If you have never used VIM then I will not recommend it. Your goal is to learn Rails and you don’t want to learn something as complex as VIM at the same time. VSCode is the best choice. Once you have succeeded in your goal of learning Rails, surely give VIM a try. I have been using it for more than 15 years now and I would not trade it for any other editor.

2 Likes

I’ve been trying really hard to switch to something else, even spent a few months on VSCode thinking this is gonna be it, but no matter what, always ended up returning to Sublime Text (for over 12 years).

I run Sublime Text side by side (using MacOS split view) with iTerm2, use NeoVintageous for vim mode. RubyTest, albeit old, still works. And for me nothing beats this. It’s fast, smooth, minimal, out of my way. Stuff that it doesn’t do well (e.g. vertical align plugins), VSCode doesn’t do well either. Stuff that it does well, it does better than VSCode. Themes, UX, linters, LSPs, CoPilot integration, they all feel considerate. GitSavvy, GitGutter is less invasive and elaborate than VSCode’s git stuff.

VSCode, in comparison, just keeps getting in my way. Too much UI. Very subjective of course, but hey.

It’s CMD+P in sublime to open file, and CMD+SHIFT+P to do pretty much anything else.

1 Like

I’m loving sublime at the moment. VSCode seems fine, but it’s not as smooth and nimble. I’m on linux (I have a mac, but it’s not where I’m doing this work). Not sure what you mean by split view. As for CTL-P, that opens a window that looks like CTL-Shift-P, the command pallette, but without commands, where I can type stuff, but it doesn’t seem to work for files. The menu claims it’s Goto-Anything, which I suspect means symbols in my project (open folder)… still plenty I don’t understand, but I figure it’ll come clear over time. CTL-o is the open file, but that’s the standard file open dialog provided by, in my case Nemo. Ugh. I keep looking for the quick-open feature where you type some of the filepath/name and hit tab with autocompletion…

Oh, I get it. You open a folder and then CTL-P will let you Go to anything in that folder tree. Meh. I guess that’s ok, but a simple fast file open that works for anywhere in the filesystem would be better. The open folder function in sublime has to index whatever folder you give it, so if you give it a large folder with lots of files, it dogs - eats cpu, slows down, etc. I figure some sublime guru knows how to fix it. I’ll keep hoping.

I figured out the split view in sublime. Greatness.

Been meaning to throw together some notes on my Sublime Text setup, so here they finally are.

2 Likes

I am a longtime user of IntelliJ IDEA (originally for Java and Kotlin and now ROR) and I find the Ruby/Rails support inside of it to be top notch (RubyMine is effectively the Ruby plug-in inside IDEA).

I regularly run everything related to the ROR project I am working on within IDEA. This makes debugging a breeze. Just set a breakpoint somewhere and go. This includes setting breakpoints inside .erb template files. No need for adding binding.pry. Running tests within IDEA is also a breeze.

If you are interested in checking it out, there are some ways to get it for free. See Buy RubyMine: Pricing and Licensing, Discounts - JetBrains Toolbox Subscription.

2 Likes

The “goto definition of [method/class]” is a must have for learning and navigating ruby apps, and RubyMine does this well.

Introspection is Ruby’s strong suit. To help with this, use the rails-pry gem. From the console you can inspect any method or class with ‘show-source’.

1 Like

I’m not a tech person but since pandemic I want to learn how to code. Y try to learn Django and Laravel but at the end Rails help me understand all the basic and more. And Ruby helps me explain to the machine what I want easily (I’m love with Ruby). Now I can create a relative complex projects and I can talk and discuss with the product and dev team and understand how to mesure the scope/resources of each sprint.

Some of my colleagues use Sublime, others VIM and others VSCode. Now we are switching to VSCode Codespaces for two main reason. Environment setup and pair programming (we are on remote and we appreciate coding in a far distance sharing the same screen as Google docs)

What happens with AI is amazing. Copilot for example not only tell me what to do to solve my problem. It can explain me why and the most important, alternatives with advantage and disadvantage. That loop helps me understand the Rails framework much better and make me enjoy coding every single day.

If someone ask me what ID etc… for Rails. I will tell him, be pragmatic like the framework. VSCode / Codespaces and GitHub Copilot just work. This is my junior dev opinion.

1 Like

If you’re on old machine (like 2009 pc’s), i would suggest you to rent AWS Lightsail vm and run vscode tunnel inside of it, so you can access full-featured environment without hassle