Cannot add remote (docker-compose) Ruby interpreter

Answered

Hi,
I have a multi-application development environment based on passenger-docker.

I'm currently using RubyMine 2018.1.1 and I cannot add remote (docker-compose) Ruby interpreter.
The problem is the ruby interpreter path!

Can't create Ruby SDK
Can't find ruby by provided interpreter path

I tried with the following values, but it doesn't work:

  • /usr/local/rvm/rubies/default/bin/ruby
  • /usr/local/rvm/rubies/ruby-2.5.1/bin/ruby
  • /usr/local/rvm/gems/ruby-2.5.1
  • /usr/local/rvm/gems/ruby-2.5.1@global

It worked with RubyMine 2017.3 serie and the bold value.

Any idea?

 

19 comments

Can you please explain me how RubyMine behaves when trying to download remote SDK. What are the requirements? Which variables must be set? If I know how it works, then I can try to find a workaround. 

I recently renewed my subscription (own founds) even if there are a few issues with my setup.

Please help me.

Many thanks,
Mauro 

0

Hello Mauro,

sorry for the delay. Could you please check how it goes in the last 2018.1.2 RC and after readding Docker configuration (Settings Build, Execution, Deployment | Docker). In case the problem persists would it be possible to provide a sample app for reproduce (you can send me it to rubymine-support@jetbrains.com)

0

Hi Olga,
removing all volumes and rebuilding everything seems to have fixed the problem.

I created a git repo with a development environment based on passenger-docker and other two git repo with sample applications. 

I'll send you an email so that you can help me with https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000216904-Passenger-Docker-multi-app-dev-environment-how-to-setup-debug-

Many thanks,
Mauro

1

Hi, I have this issue again.

I tried to reset docker to factory defaults but the problem still persists.

It is really frustrating...

You can find a demo of my setup (docker based env + 2 apps) at:
https://gitlab.com/my-passenger-docker

Many thanks,
Mauro

0

Any update on this? 

It is frustrating to pay for something that seems NOT to work.
I also created a demo of my setup in order to help with the debugging procedure, did you try it.

It is painful to develop without Ruby SDK (for autocomplete etc) & debugging.

Many thanks,
Mauro

0

Hello Mauro,

unfortunately at the moment there're no updates. Since you've voted for the corresponding issue (https://youtrack.jetbrains.com/issue/RUBY-21624) you'll receive a notification as soon as there's any change of the issue's state.

0

Hello Olga,
is there any workaround to this? Working without the SDK is painful.

BTW: https://youtrack.jetbrains.com/issue/RUBY-21624 is not the related issue.

Many thanks,
Mauro

2

Hey Mauro, I know it's a little late, but did you select the right application in the "service" option of the configuration?

I ask because this was happening to me and I didn't realize I had to chose the service that has a container with ruby installed on it

0

Hi Robcontreras, many thanks for your reply.

In my setup I have two services, one based on passenger-docker and one on mysql official image, I always chose the correct one.

My issue was related to ruby executable path. The RubyMine support team helped me a few months ago, the solution is to use the path to rvm (/usr/local/rvm/bin/rvm in my situation) and not the one to the ruby executable.

Mauro

 

0

Similar setting (Rails, Postgres and Redis container via local Docker compose) and same issue as Mauro N: "There are no rubies installed". All recommended and (via which ...) existing paths to ruby and rvm tested (not only local, but also in Rails container). Very frustrating. Any updates? Issue addressed or solved in RubyMine 2019.1?

Ruby path in Rails Container: /usr/local/bin/ruby (no RVM installed)

Local Ruby path: ~/.rvm/rubies/ruby-2.6.0/bin/ruby (no default Ruby installed)

Local RVM path: ~/.rvm/bin/rvm

Stefan

0

Hello Stefan,

in case you have the same issue as Mauro then it was caused by the misconfiguration. Still it'd be great if you could check how it goes in 2019.1 RC. If the problem persists then could you please share your Dockerfile, docker-compose.yml and Gemfile.

0

Hello Olga, thanks for your reply.
Same issue in RubyMine 2019.1 RC. I have moved from RVM to RBENV in the meantime.

Build #RM-191.6183.108, built on April 1, 2019
JRE: 1.8.0_202-release-1483-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.18.0-17-generic

/usr/local/bin/ruby (path to ruby in running container)
/home/stefan/.rbenv/shims/ruby (local)
/home/stefan/.rbenv/versions/2.6.2/bin/ruby (local)
-> Can't find ruby by provided interpreter path

/usr/bin/rbenv (local)
/home/stefan/.rbenv/bin/rbenv (local)
-> There are no rubies installed

| please share your Dockerfile, docker-compose.yml and Gemfile
PM?

0

Same issue for me.

No rvm involved. My setup uses plain ruby 2.5 installed at /usr/bin/ruby from alpine 3.9 package.

Readding Docker configuration as suggested by Olga had no effect.
Using /usr/bin/ruby in "Ruby or version manager path" did not fix the issue. The progress bar stalls with "Fetching version string" and another popup opens saying "Can't find ruby or interpreter path"

I cannot find any problems when running docker-compose on cli, using same setup like in rubymine settings:
docker-compose -f my-docker-compose.yml run --no-deps my-service /usr/bin/ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-musl]

The strange thing about that:
I was lucky and one service from docker-compose.yml could be used as remote interpreter without error.
I created a duplicate of this service configuration in docker-compose.yml, just changed the service name and tried to use it as remote interpreter in rubymine. But this time, "Can't find ruby or interpreter path"

RubyMine 2019.1
Build #RM-191.6183.108, built on April 1, 2019
JRE: 1.8.0_202-release-1483-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.9.0-8-amd64

0

Bingo. I used the experimental feature "ruby.docker.internal.via.exec " which was suggested in https://blog.jetbrains.com/ruby/2019/03/rubymine-docker/#docker_support_updates
After disabling it, I could add all remote interpreter without problems

0

Thank you stmllr to point us to Experimental features! Some of my findings:

Issue 1: Inconsistent Experimental feature dis/appearing
3 x Shift > Experimental features ... > Check "ruby.docker.internal.via.exec" > Ok
Edit Configurations ... > No docker-compose area (exec / up / run) shown
Restart RubyMine IDE > Edit Configurations ... > docker-compose area shown
3 x Shift > Experimental features ... > Uncheck "ruby.docker.internal.via.exec" > Ok
Edit Configurations ... > docker-compose area (exec / up / run) still shown at exec
Restart RubyMine IDE > Edit Configurations ... > docker-compose area still shown at exec
Maybe more a feature than a bug...

Progress 1: Remote debugger for docker-compose after not intended step goes through!
Prepositions: ruby.docker.internal.via.exec is unchecked, docker-compose still shown at exec
Menu > File > Settings > Languages & Frameworks > Ruby SDK & Gems > Select interpreter Path > New remote...
Check "Docker" (not "Docker compose") > Set "Image name" to web_app (my running Rails container) > Set "Ruby or version manager path" to "/home/stefan/.rbenv/bin/rbenv" > Ok
Creating Ruby SDK > Progress bar goes through. Images busybox:latest and rubymine_helpers:RM-191.6183.108 fetched, rbenv found
URGENT: After this someway not intended step, set Remote debugger for "Docker compose" (not "Docker") goes through too in same manner!

My guess: Setting up Remote Debugger for Docker resolves over a side effect the problem with finding ruby ​​/ rvm / rbenv when setting up Remote Debugger for Docker compose. Once executed, afterwards (I suspect also on the systems of the developers of RubyMine) the bug may not occur anymore.

UPDATE: Issue 1 aggravated: Experimental feature ruby.docker.internal.via.exec now does not trigger anymore, docker-compose area in Edit Configuration is never shown more. Progress 1 not reproducible: After deleting the above successfull created remote debugger SDK, the same problem as before but for both "Docker" and "Docker compose" -> no ruby ​​found.

0

On RubyMine 2019.1.1 it doesn't work anymore! Frustrating!

I'm using the path to version manager: /usr/local/rvm/bin/rvm

The returned error is:

Can't create Ruby SDK
Error getting list of installed rubies


Mauro

 

0

Hello Mauro,

it'd be great if you could provide Dockerfile, docker-compose.yml (or a project sample) for reproducing. 

0

Please sign in to leave a comment.