Rubymine WSL Gem detection

For some reason I can't seems to make Rubymine detect my gems on rails project when using through WSL.

I'm using WSL 2 (Debian) with RubyMine 2021.3.2 as ruby version manager I'm using Rbenv with ruby version 3.0.3

I got the framework detected without trouble but the gems part remain empty.

When opening rails files I've got error like it don't know it's in rails :


As I'm new to rubymine I guess I'm missing something in the settings.

If anyone got some clue, It would be of great help :)

9 comments
Comment actions Permalink

Hello,

Could you please also specify where your project is located, is it on Windows FS or inside WSL? In addition, does anything happen on clicking Synchronize button (in Settings | Ruby SDK and Gems)?

0
Comment actions Permalink

Hello,

The project is inside WSL.

As for the sync, sadly nothing happen when I click on it, there's the "update" and then "nothing to show".

0
Comment actions Permalink

Could you please specify how you installed rbenv inside WSL? In addition, at the moment working with projects located inside WSL might cause problems (https://youtrack.jetbrains.com/issue/RUBY-25956), still it shouldn't affect the way gems are synchronized. 

0
Comment actions Permalink

Sure, it was installed using 

sudo apt install rbenv

as well as some git clone for plugins :

I also tried installing my project on a VM and got the same problems with Gems sync, so I'm guessing it has maybe something to do with the project configuration and not WSL itself but I'm not sure about that.

0
Comment actions Permalink

Usually version managers aren't installed via sudo so probably it affected the gems' synchronization. Would it be possible to re-install or check on another server rbenv without sudo?

0
Comment actions Permalink

I'll try this and come back to you once I'll be done :)

0
Comment actions Permalink
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
~/.rbenv/bin/rbenv init

git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
rbenv install 3.0.3
rbenv global 3.0.3 && rbenv rehash

 

Still not working with rubymine sadly.

0
Comment actions Permalink

Worked for me afeter installing rsync on wsl machine

1
Comment actions Permalink

Using Amazon Linux 2 in WSL2, the solution from Emanuelbotelho worked for me.  My project is outside WSL2, but mounted inside it.  Very convoluted, for sure.

0

Please sign in to leave a comment.