44

I'm using a Docker image with some specified environmental variables, such as GEM_HOME and BUNDLE_PATH.

RubyMine connects to the remote Docker SDK just fine, but I can't see gems added by bundler, even though bundler itself is there. My profiler can't configure the project because of that, so I am forced to start all tasks and servers from the Terminal.

Ruby SDK and Gems

How do I make my bundle gems visible?


UPD

It actually has a deal with custom bundle gems path. After it was changed, gems disappeared from gem list. RubyMine takes gems from there, so it can't find those gems.

Does anybody know how to make gem list with bundler custom gems path?


UPD 2

Even after adding bundle gems to gem list I'm having the same issue :(

Viktor
  • 4,218
  • 4
  • 32
  • 63
  • I have the same issue. I based my docker development environment on https://github.com/phusion/passenger-docker and I have multiple projects. Gems are shared between projects (custom BUNDLE_PATH) in order to improve performances (docker volumes slowness on OSX). – Mauro Nidola May 31 '17 at 15:04
  • I also have this exact same issue. It seems related to including a `--path` argument with your `bundle install` command but I can't figure out how to resolve this. For example, we use the very reasonable `RUN bundle install --path vendor/bundle` line in our Dockerfile. – TheCatParty Mar 14 '18 at 15:27
  • 1
    In your `Dockerfile`, are the env variables `GEM_HOME` and `BUNDLE_PATH` set appropriately? If running `gem list` inside the container shows the gems, I think RubyMine now picks them up. Is this still not working for you? – ms-ati Aug 02 '18 at 21:24
  • 1
    Do you have the docker working path mounted properly? It sound like you can communicate over the port just fine, but I believe rubymine needs to be able to peer into the filesystem. On vagrant I used to have to mount my drive into the container/virtual machine to allow them to talk both ways. – awsmsce Oct 26 '18 at 21:44
  • Are you using rbenv or something similar? – Cninroh Dec 13 '19 at 15:49
  • 1
    Has anyone figured out this issue? I find Rubymine extremely frustrating to setup. – Raymond Ruiz-Veve Jan 19 '20 at 19:26
  • Am using rbenv and i have the same issue ? any ideas ? – Almokhtar Sep 10 '21 at 18:37

1 Answers1

2

I also struggled with the same problem.

Managed to fix it by setting this parameters in ~/.zshc user profile.

You might have different RUBY_PATH, feel free to change it.

export RUBY_PATH=/usr/local/opt/ruby/bin
export PATH="$RUBY_PATH:$PATH"
export RUBY_VERSION=$($RUBY_PATH/ruby -e "puts RUBY_VERSION")
export PATH="/usr/local/lib/ruby/gems/$RUBY_VERSION/bin:$PATH"
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$GEM_HOME/ruby/$RUBY_VERSION"

You can also take it from this gist

Dharman
  • 30,962
  • 25
  • 85
  • 135
Baurito
  • 121
  • 1
  • 9