Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant RbConfig::TOPDIR #5562

Closed
anup1710 opened this issue Jan 17, 2019 · 4 comments
Closed

uninitialized constant RbConfig::TOPDIR #5562

anup1710 opened this issue Jan 17, 2019 · 4 comments
Milestone

Comments

@anup1710
Copy link

anup1710 commented Jan 17, 2019

I have installed the latest JRUBY for windows from
https://s3.amazonaws.com/jruby.org/downloads/9.2.5.0/jruby_windows_x64_9_2_5_0.exe
and I tried to install bundler gem and I get uninitialized constant RbConfig::TOPDIR error for all bundle commands

Environment

Provide at least:

  • JRuby version (jruby -v) : jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b15 +jit [mswin32-x86_64]
  • Operating system and platform (e.g. uname -a) : MINGW64_NT-6.1 Machine 2.4.0(0.292/5/3) 2016-01-05 14:13 x86_64 Msys

Other relevant info you may wish to add:

  • Application/framework version : Sinatra with 2.0.5 version
  • Environment variables:
$ jruby -S gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.2
  - RUBY VERSION: 2.5.0 (2018-12-06 patchlevel 0) [java]
  - INSTALLATION DIRECTORY: C:/JRuby/jruby-9.2.5.0/lib/ruby/gems/shared
  - USER INSTALLATION DIRECTORY: C:\Users\anup/.gem/jruby/2.5.0
  - RUBY EXECUTABLE: C:/JRuby/jruby-9.2.5.0/bin/jruby.exe
  - GIT EXECUTABLE: C:\program files\github\git\mingw64\bin/git.EXE
  - EXECUTABLE DIRECTORY: C:/JRuby/jruby-9.2.5.0/bin
  - SPEC CACHE DIRECTORY: C:\Users\anup/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/JRuby/jruby-9.2.5.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-java-1.8
  - GEM PATHS:
     - C:/JRuby/jruby-9.2.5.0/lib/ruby/gems/shared
     - C:\Users\anup/.gem/jruby/2.5.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-rdoc --no-ri --env-shebang"
     - "update" => "--no-rdoc --no-ri --env-shebang"
     - :benchmark => false
     - :sources => ["http://rubygems.org/"]
  - REMOTE SOURCES:
     - http://rubygems.org/
  - SHELL PATH:
     - C:\Users\anup\bin
     - C:\program files\github\git\mingw64\bin
     - C:\program files\github\git\usr\local\bin
     - C:\program files\github\git\usr\bin
     - C:\program files\github\git\usr\bin
     - C:\program files\github\git\mingw64\bin
     - C:\program files\github\git\usr\bin
     - C:\Users\anup\bin
     - C:\Ruby25\bin
     - C:\Program Files (x86)\Common Files\Oracle\Java\javapath
     - C:\bin
     - C:\WINDOWS\system32
     - C:\WINDOWS
     - C:\WINDOWS\System32\Wbem
     - C:\WINDOWS\System32\WindowsPowerShell\v1.0
     - C:\JRuby\jruby-1.7.21\bin
     - C:\apache-maven-2.2.1\bin
     - C:\Program Files\nodejs
     - C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE
     - C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn
     - C:\Program Files\Microsoft SQL Server\100\Tools\Binn
     - C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn
     - C:\Program Files (x86)\WebEx\Productivity Tools
     - C:\Program Files\java\jdk1.8.0_45\bin
     - C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn
     - C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio
     - C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn
     - C:\Program Files\Microsoft SQL Server\120\Tools\Binn
     - C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn
     - C:\Program Files (x86)\Webex\Webex\Applications
     - C:\JRuby\jruby-9.2.5.0\bin
     - C:\jruby-9.2.5.0\bin
     - C:\Users\anup\AppData\Roaming\npm
     - C:\Program Files\Github\Git\cmd
     - C:\tools
     - C:\program files\github\git\usr\bin\vendor_perl
     - C:\program files\github\git\usr\bin\core_perl

Expected Behavior

  • gem command like install/update should run properly without any error on windows

Actual Behavior

Below error comes when we run the gem install command

image

Backtrace

$ jruby -S gem install bundler --backtrace
ERROR:  While executing gem ... (NameError)
    uninitialized constant RbConfig::TOPDIR
        org/jruby/RubyModule.java:3534:in `const_missing'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:775:in `windows_stub_script'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:473:in `block in generate_windows_script'
        org/jruby/RubyIO.java:1154:in `open'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:472:in `generate_windows_script'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:535:in `generate_bin_script'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:508:in `block in generate_bin'
        org/jruby/RubyArray.java:1792:in `each'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:491:in `generate_bin'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/installer.rb:324:in `install'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/resolver/specification.rb:93:in `install'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/request_set.rb:195:in `block in install'
        org/jruby/RubyArray.java:1792:in `each'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/request_set.rb:183:in `install'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:212:in `install_gem'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:264:in `block in install_gems'
        org/jruby/RubyArray.java:1792:in `each'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:258:in `install_gems'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:165:in `execute'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/command.rb:321:in `invoke_with_build_args'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/command_manager.rb:176:in `process_args'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/command_manager.rb:146:in `run'
        C:/JRuby/jruby-9.2.5.0/lib/ruby/stdlib/rubygems/gem_runner.rb:59:in `run'
        C:/JRuby/jruby-9.2.5.0/bin/jgem:21:in `<main>'
        org/jruby/RubyKernel.java:1007:in `load'
        C:/JRuby/jruby-9.2.5.0/bin/gem:4:in `<main>'
@anup1710 anup1710 changed the title uninitialized constant RbConfig::TOPDIR uninitialized constant RbConfig::TOPDIR Jan 17, 2019
@kares
Copy link
Member

kares commented Jan 18, 2019

interesting. what is your rubygems version? jruby -S gem -v

seems that this is an incompatibility with MRI (at least since 2.3) :

2.3.6 :001 > RbConfig::TOPDIR
 => "/opt/local/rvm/rubies/ruby-2.3.6" 

... should be an easy fix but if RGs depends on this JRuby needs to figure out how to set for embed mode

@kares kares added this to the JRuby 9.2.6.0 milestone Jan 18, 2019
@anup1710
Copy link
Author

rubygems version is

$ jruby -S gem -v
2.4.8

@kares
Copy link
Member

kares commented Jan 23, 2019

just for the record TOPDIR was added, however I am still not sure how you run into this.
9.2.5.0 comes with RGs 2.7.x installed, and also the lines from the trace do not much with 2.4.8
also there seems to be no TOPDIR usage in 2.4.8 or shipped 2.7 version

@anup1710
Copy link
Author

Thanks for the quick response and fixing the issue. I will check the changes and let you know. I am also not sure why its coming, I have only installed jruby from .exe file and tried to install the bundler to upgrade my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants