Sublime Forum

Could Ruby integration Just Work™?

#1

I’ve been using Sublime Text since v2 and lately I’ve been fatigued by the amount of work it takes to get ST working with Ruby. I think the problem is ST uses the system Ruby by default, but lots of people these days are using different version of Ruby specified by version managers like rbenv, and it changes depending on the project directory.

Here’s my request: could ST have better defaults for Ruby? I want to open a Ruby file, press Cmd + B, and have it use Ruby from my Ruby version manager. When I install the Ruby LSP, like solargraph it should also Just Work ™ instead of giving me errors like this:

0 Likes

#2

Ruby build system hasn’t changed since ST2. As LSP it just calls ruby to perform tasks, which “just” requires the correct ruby executable to be pointet to by $PATH.

ST doesn’t have an idea of what kind of extra tools are used to setup certain environments nor does it about ruby projects’ folder structure or setup files.

LSP supports project-specific settings in *.sublime-project files.

Maybe someone with enough ruby experience could write a plugin to auto-detect special ruby envs and and tweak LSP settings and provide a more sophisticated build system runner, which is aware of them. But that’s out of scope for ST core.

1 Like

#3

I can appreciate how the ST core team doesn’t to take on language integrations, but know that other text editors are solving this problem. For example, despite Zed being a new editor and having a lot of other issues that Sublime Text doesn’t have, its integration with Ruby and the solargraph LSP “Just Works”, which is impressive for such a new entrant.

I understand that Sublime Text isn’t my project or organization, but I do want to raise the issue that its rough using Ruby out of the box with ST and hope to see the core team tackle this or the ST organization spin-up some language integration teams that can worry about all the details of making $LANGUAGE work on $OPERATING_SYSTEM with $VERSION_MANGER with minimal to no configuration.

0 Likes

#4

I’d like to second this issue. I’ve been a long time sublime customer (ST2, ST3, & ST4). I’d like to continue to use Sublime and it would be great if the world didn’t turn into a monoculture of VS Code.

However, it’s really frustrating how hard it is get a core, vanilla Ruby on Rails development environment working smoothly in ST4 vs VS Code.

I understand that the ST core team has no obligation to take on language integrations, but if the ST core team doesn’t make it easy for developers to use the “most common” configuration(s), then people are going to switch to things that “just work” and are free rather than paying for something that consumes time and causes frustration.

I would describe most common as:

  • Ruby
  • With a version manager (unfortunately any of rbenv, chruby, rvm, or asdf)
  • Using ruby-lsp
  • Using rubocop
  • Using bundler
  • for a Rails project
  • on Mac or Linux

I know that this isn’t just one path & it’s going to be a pain in the ass. But it’s got to be a less of a PITA for the ST Core team who understands how all of this works in ST than it is for some random developer who trying to figure it out once.

0 Likes

#5

Realistically it will would need to be a community initiative like everything else. Because if you ask SublimeHQ “What is the ultimate ST setup for Ruby?” then the answer is almost certainly “We don’t know - You tell us”.

0 Likes