Bundler/Gem integration fails with vagrant and rbenv
Hi all,
I'm having trouble running bundle install using the RubyMine Gem Manager with Vagrant and Rbenv.
For some reason Rubymine doesn't seem to be able to be able to find the SDK when running gem commands, and it won't list the available gems in the SDK settings panel, even though:
- I can run bundle/gem install from vagrant ssh
- I can remotely exec ruby files via the RubyMine runner
- RubyMine accepts the remote ruby binary when I set up it as an SDK
Here is my gem environment:
RUBYGEMS VERSION: 2.6.11
RUBY VERSION: 2.4.1 (2017-03-22 patchlevel 111) [x86_64-linux]
INSTALLATION DIRECTORY: /home/vagrant/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0
USER INSTALLATION DIRECTORY: /home/vagrant/.gem/ruby/2.4.0
RUBY EXECUTABLE: /home/vagrant/.rbenv/versions/2.4.1/bin/ruby
EXECUTABLE DIRECTORY: /home/vagrant/.rbenv/versions/2.4.1/bin
SPEC CACHE DIRECTORY: /home/vagrant/.gem/specs
SYSTEM CONFIGURATION DIRECTORY: /home/vagrant/.rbenv/versions/2.4.1/etc
RUBYGEMS PLATFORMS:
ruby
x86_64-linux
GEM PATHS:
/home/vagrant/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0
/home/vagrant/.gem/ruby/2.4.0
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:backtrace => false
:bulk_threshold => 1000
"gem" => "--no-rdoc --no-ri"
REMOTE SOURCES:
https://rubygems.org/
SHELL PATH:
/home/vagrant/.rbenv/versions/2.4.1/bin
/home/vagrant/.gem/ruby/2.4.0/bin
/home/vagrant/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/bin
/usr/local/bin
/usr/bin
/bin
/usr/games
----------------------
IDE: RubyMine 2017.2.4, build #RM-172.4155.44
OS: Linux 4.9.0-4-amd64[amd64]
Java: 1.8.0_152-release-915-b11
RubyMine SDK Environment:
Sdk: Remote:ruby-2.4.1-p111
Sdk Version: ver.2.4.1p111 ( revision 58053) p111
Ruby Interpreter: vagrant:///home/andrew/ruby/warehouse/home/vagrant/.rbenv/versions/2.4.1/bin/ruby
RVM Sdk: no
RVM Home: [n/a]
Sdk Language Level: 2.4
Sdk Load Path:
~/opt/RubyMine-2016.3.1/rubystubs24
~/opt/RubyMine-2016.3.1/rubystubs24
Sdk Gem paths:
~/.RubyMine2017.2/system/ruby_stubs/-2004793297/-1748717324/gems
~/.RubyMine2017.2/system/ruby_stubs/-2004793297/-1748717324/bundler/gems
~/.RubyMine2017.2/system/ruby_stubs/-2004793297/-1684336589/gems
~/.RubyMine2017.2/system/ruby_stubs/-2004793297/-1684336589/bundler/gems
Gems used for 'warehouse':
Below are screen shots of the error and my settings:



Is there anything I need to change or do differently? I've successfully used Vagrant, rbenv with Rubymine before, but that was with windows and ruby 2.3.3
Thanks in advance
Please sign in to leave a comment.
Hello,
could you please provide your Vagrantfile or specify the box you're using.
Hi,
I'm using debian stretch64, below is my Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"
config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
config.vm.synced_folder './', '/vagrant', type: 'virtualbox'
config.vm.provision "shell", privileged: false, path: 'provision.sh'
end
Hi Andrew,
sorry for the delay. I've checked adding rbenv SDK after setting Vagrant based on your Vagrantfile (I commented the last 2 lines though) and it worked fine (was checking on RM-173.3727.77).