简体   繁体   English

JRuby 不会在正确的路径中安装 gems

[英]JRuby won't install gems in correct path

I have issues trying to install gems listed in my gemfile.我在尝试安装我的 gemfile 中列出的 gem 时遇到问题。 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.我有一个较新版本的 JRuby jruby-9.2.19.0但最终卸载了这个版本并下载了jruby-9.1.17.0版本并将其设置为默认解释器。

After checking the environment/path settings with gem env I can see the following info:使用gem env检查环境/路径设置后,我可以看到以下信息:

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 bundle install命令最终会创建一个名为: jruby-9.2.19.0的新目录,并将 gems 安装到路径: 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.我尝试在 RubyMine 本身内使Invalidating Caches ,但没有帮助。

What could be causing this issue where JRuby/RubyMine wont install in the correct directory even though the gem environment has the correct path?即使 gem 环境具有正确的路径,JRuby/RubyMine 也不会安装在正确的目录中,这可能导致此问题的原因是什么?

After trying out for days, I used the bundle config documentation which says to use bundle config list to view the set configs.在尝试了几天之后,我使用了 bundle config 文档,其中说使用bundle config list查看设置的配置。

Through this, I found that the bundler had set a path for where the gems should be installed.通过这个,我发现 bundler 已经设置了应该安装 gem 的路径。

After deleting the config, everything seems to work normally as it should!删除配置后,一切似乎都正常工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM