RubyMine SSH remote interpreter within docker container.

We are trying to setup SSH remote interpreter to the local docker container to debug Rails application.

We don't want to use remote Docker interpreter since we need our container to run in background, and want occasionally run debug sessions within running container.


We do have ssh server run in container and able to connect remote ruby interpreter to it, but we can't run/debug anything using it. 
Other issue, we have an empty gem list in IDE for this interpreter.

We try to run the simplest possible setup now, generated Rails App Stub and standard ruby image: 


FROM ruby:2.3.0

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
nodejs \
openssl \

RUN echo "root:root" | chpasswd
RUN sed -i -e '/PermitRootLogin/ s/ .*/ yes/' /etc/ssh/sshd_config
RUN mkdir /var/run/sshd

RUN gem install bundler --no-ri --no-rdoc

RUN mkdir -p /app

# copy src with Gemfile
ADD . /app
RUN bundle install

EXPOSE 3000 22

CMD ["/usr/sbin/sshd", "-D"]

Remote interpreter settings:

When we try to add this interpreter to Rails Run Configurations it fails to run with [No Rails found in SDK].

Again we do not try to use some special setup here, standard Ruby Image with bare generated rails scaffold app, so if you have a working setup it would be really awesome to see it. 

So the questions are: 
  Is it possible to run such setup at all?
  If so, what we were missing in our setup?


System Info:

RubyMine 2017.2.1
Build #RM-172.3544.29, built on July 28, 2017
Licensed to RubyMine Evaluator
Expiration date: September 7, 2017
JRE: 1.8.0_152-release-915-b6 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6 


Thanks in advance


Hello Ayrov, sorry for delay with answer. We managed to reproduce the problem. 

In your configuration gem installed to /usr/local/bundle. To get gem installation directory at remote host RubyMine uses command “gem env gempath”. This command returns wrong list of gem roots.

We are going to fix it by calling “bundle exec env gempath”. Fix will be available in one of the next releases of RubyMine. Please vote for

As workaround you could modify environment variables GEM_PATH, GEM_ROOT or BUNDLE_PATH in your Dockerfile. Found related discussion here: Let us know if you need help with it.


hi, I tried to specify GEM_PATH and GEM_ROOT (BUNDLE_PATH is already pointing to the right folder) in dockerfile so that `gem env gempath` gives the same path as `bundle exec gem env gempath` but with no luck, it doesn't solve issue with empty gem list.

Could you give me a more detailed description/instructions of what should be done here? 


Please sign in to leave a comment.