RubyMine doesn't see gems from bundle in Docker on Mac OS
Asked Answered
E

1

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 :(

Elyn answered 29/3, 2017 at 10:25 Comment(7)
I have the same issue. I based my docker development environment on 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).Christadelphian
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.Concretize
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?Batten
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.Gonfanon
Are you using rbenv or something similar?Toggery
Has anyone figured out this issue? I find Rubymine extremely frustrating to setup.Presber
Am using rbenv and i have the same issue ? any ideas ?Meetinghouse
F
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

Flock answered 2/3, 2022 at 6:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.