Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.7k views
in Technique[技术] by (71.8m points)

ruby - `require': cannot load such file -- radic (LoadError)

I am trying to run a shell script on a Mac and it throws the below error at require 'radic'

I see that radic is part of gem list by running the below command

$ gem list | grep radic
radic (0.12.4)

Following is my gem env, it looks like the shell script is picking a 2.6 version instead of the 3.0 version, is that the problem?if so, how can I fix it?

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.3
  - RUBY VERSION: 3.0.0 (2020-12-25 patchlevel 0) [x86_64-darwin19]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/3.0.0
  - USER INSTALLATION DIRECTORY: /Users/username/.gem/ruby/3.0.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin
  - SPEC CACHE DIRECTORY: /Users/username/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/3.0.0_1/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-darwin-19
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/3.0.0
     - /Users/username/.gem/ruby/3.0.0
     - /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["https://rubygems.company.com"]
     - :concurrent_downloads => 8
  - REMOTE SOURCES:
     - https://rubygems.company.com
  - SHELL PATH:
     - /usr/local/opt/ruby/bin
     - /Users/username/.rbenv/shims
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/companyinternal/bin
     - /opt/company/bin
     - /opt/xbs/bin

Ruby version

$ ruby --version
    ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]

ERROR:-

$ ./change_query_launcher.sh 
Encryption type des3-cbc-sha1(16) used for authentication is weak and will be deprecated
Traceback (most recent call last):
    5: from /Users/username/pythonscripts/foldername-changebot/change_query.rb:6:in `<main>'
    4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    2: from /Users/username/pythonscripts/foldername-changebot/btt-radic.rb:4:in `<top (required)>'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- radic (LoadError)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...