Home > Software engineering >  JRuby won't install gems in correct path
JRuby won't install gems in correct path

Time:10-01

I have issues trying to install gems listed in my gemfile. I had a newer version of JRuby jruby-9.2.19.0 but ended up uninstalling this version and downloading the jruby-9.1.17.0 version and set it as the default interpreter.

After checking the environment/path settings with gem env I can see the following info:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.14.1
  - RUBY VERSION: 2.3.3 (2018-04-20 patchlevel 0) [java]
  - INSTALLATION DIRECTORY: C:/jruby-9.1.17.0/lib/ruby/gems/shared
  - USER INSTALLATION DIRECTORY: C:/Users/(my_name)/.gem/jruby/2.3.0
  - RUBY EXECUTABLE: C:/jruby-9.1.17.0/bin/jruby.exe
  - EXECUTABLE DIRECTORY: C:/jruby-9.1.17.0/bin
  - SPEC CACHE DIRECTORY: C:/Users/(my_name)/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/jruby-9.1.17.0/etc

So the installation directory is correct:

C:/jruby-9.1.17.0/lib/ruby/gems/shared

as expected.

BUT when I run:

bundle install the command ends up creating a new directory with the name: jruby-9.2.19.0 and installs the gems into the path: C:\jruby-9.2.19.0\lib\ruby\gems\shared\gems\jruby\2.3.0

I tried Invalidating Caches within RubyMine itself and it didn't help.

What could be causing this issue where JRuby/RubyMine wont install in the correct directory even though the gem environment has the correct path?

CodePudding user response:

After trying out for days, I used the bundle config documentation which says to use bundle config list to view the set configs.

Through this, I found that the bundler had set a path for where the gems should be installed.

After deleting the config, everything seems to work normally as it should!

  • Related