chruby icon indicating copy to clipboard operation
chruby copied to clipboard

Gem Load Error -- Cannot Find Installed Gem

Open kingbari opened this issue 12 years ago • 7 comments
trafficstars

I installed JRuby on Cygwin as per the chruby v0.3.5 jruby installation guide.

I then installed jruby-lint via: jruby -S gem install jruby-lint and the gem executable was installed, as expected, at /cygdrive/c/Cygwin/home/Ari/.gem/jruby/1.9.3/bin/jrlint. However, when I run jrlint, I get the error:

Gem::LoadError: Could not find 'jruby-lint' (>= 0) among 0 total gem(s) to_specs at C:/Cygwin/opt/rubies/jruby-1.7.4/lib/ruby/shared/rubygems/dependency.rb:296 to_spec at C:/Cygwin/opt/rubies/jruby-1.7.4/lib/ruby/shared/rubygems/dependency.rb:307 gem at C:/Cygwin/opt/rubies/jruby-1.7.4/lib/ruby/shared/rubygems/core_ext/kernel_gem.rb:47 (root) at C:\Cygwin\home\Ari.gem\jruby\1.9.3\bin\jrlint:22

If I include the full path to the executable, it runs.

I've checked the $PATH variable and it does include the jruby bin directory: /cygdrive/c/Cygwin/home/Ari/.gem/jruby/1.9.3/bin

Appreciate thoughts/insights on this matter.

kingbari avatar Jun 19 '13 21:06 kingbari

Could you post your gem env?

postmodern avatar Jun 19 '13 23:06 postmodern

Home Env: export HOME="C:/Cygwin/home/$USER"

Gem Env:

RubyGems Environment:                                                                               
  - RUBYGEMS VERSION: 2.0.3                                                                         
  - RUBY VERSION: 1.9.3 (2013-05-16 patchlevel 392) [java]                                          
  - INSTALLATION DIRECTORY: C:/Cygwin/home/Ari/.gem/jruby/1.9.3                                    
  - RUBY EXECUTABLE: C:/Cygwin/opt/rubies/jruby-1.7.4/bin/jruby.exe                                 
  - EXECUTABLE DIRECTORY: C:/Cygwin/home/Ari/.gem/jruby/1.9.3/bin                                  
  - RUBYGEMS PLATFORMS:                                                                             
    - ruby                                                                                          
    - universal-java-1.7                                                                            
  - GEM PATHS:                                                                                      
     - C:/Cygwin/home/Ari/.gem/jruby/1.9.3                                                         
     - C:/Cygwin/home/Ari/.gem/jruby/1.9.3:C:/Cygwin/opt/rubies/jruby-1.7.4/lib/ruby/gems/shared   
  - 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"                                                
  - REMOTE SOURCES:                                                                                 
     - https://rubygems.org/                                                                        

kingbari avatar Jun 20 '13 00:06 kingbari

Also what is your PATH? Maybe the wrong gem command is being invoked?

postmodern avatar Jun 20 '13 00:06 postmodern

Path:

C:/Cygwin/home/Ari/.gem/jruby/1.9.3/bin:C:/Cygwin/opt/rubies/jruby-1.7.4/lib/ru
opt/rubies/jruby-1.7.4/bin:/usr/local/bin:/usr/bin:/bin:C:/Cygwin/home/Ari/bin 

kingbari avatar Jun 20 '13 01:06 kingbari

and what does gem which jruby-lint say vs. jruby -S gem which jruby-lint?

postmodern avatar Jun 20 '13 01:06 postmodern

gem which jruby-lint and jruby -S gem which jruby-lint both return: ERROR: Can't find ruby library file or shared library jruby-lint

However, both gem list -l and jruby -S gem list -l include jruby-lint:

*** LOCAL GEMS ***
blankslate (2.1.2.4)
bouncy-castle-java (1.5.0147) edn (1.0.0)
jruby-jars (1.7.4)

jruby-lint (0.4.1)

jruby-openssl (0.8.8)
jruby-rack (1.1.13.2)
mini_portile (0.5.0)
nokogiri (1.6.0 java)

kingbari avatar Jun 20 '13 01:06 kingbari

The ":" in PATH are likely problematic, no? (both paths separator and drive/path separator) HOME should probably be set to /cygdrive/c/Cygwin/home/Ari/.gem/jruby/1.9.3/bin or such. (Actually, it is not set by default?)

And please paste type gem or which gem.

eregon avatar Jul 26 '13 10:07 eregon