I used Homebrew to install a newer version of ruby on macOS Big Sur. When I try to install docker-sync by using Homebrew's gem, it installs version 0.0.11. When I use macOS system default gem it installs version 0.5.14.
Homebrew installs gem to /usr/local/opt/ruby/bin/gem:
$ /usr/local/opt/ruby/bin/gem install docker-sync
Fetching docker-sync-0.0.11.gem
Successfully installed docker-sync-0.0.11
Parsing documentation for docker-sync-0.0.11
Installing ri documentation for docker-sync-0.0.11
Done installing documentation for docker-sync after 0 seconds
1 gem installed
macOS' default gem is placed at /usr/bin/gem:
$ sudo /usr/bin/gem install docker-sync
Fetching docker-sync-0.5.14.gem
Successfully installed docker-sync-0.5.14
Parsing documentation for docker-sync-0.5.14
Installing ri documentation for docker-sync-0.5.14
Done installing documentation for docker-sync after 0 seconds
1 gem installed
When I install docker-sync using Homebrew's gem and then call gem update I run into an error:
$ /usr/local/opt/ruby/bin/gem update
Updating installed gems
Updating docker-sync
ERROR: While executing gem ... (NoMethodError)
undefined method `request' for nil:NilClass
If I search for docker-sync, homebrew's gem is listing the right version:
$ /usr/local/opt/ruby/bin/gem search docker-sync
*** REMOTE GEMS ***
docker-sync (0.5.14)
rake-tasks-docker-sync (1.0.0)
The configuration of Homebrew's gem looks like this:
$ /usr/local/opt/ruby/bin/gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.2.3
- RUBY VERSION: 3.0.0 (2020-12-25 patchlevel 0) [x86_64-darwin20]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/3.0.0
- USER INSTALLATION DIRECTORY: /Users/mylogin/.gem/ruby/3.0.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin
- SPEC CACHE DIRECTORY: /Users/mylogin/.local/share/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/3.0.0_1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-20
- GEM PATHS:
- /usr/local/lib/ruby/gems/3.0.0
- /Users/mylogin/.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
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/opt/ruby/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/TeX/texbin
The configuration of macOS' default gem looks like this:
$ /usr/bin/gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.3
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [universal.x86_64-darwin20]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.6.0
- USER INSTALLATION DIRECTORY: /Users/mylogin/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/mylogin/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-20
- GEM PATHS:
- /Library/Ruby/Gems/2.6.0
- /Users/mylogin/.gem/ruby/2.6.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/opt/ruby/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/TeX/texbin
I run /usr/local/opt/ruby/bin/gem sources -u and /usr/local/opt/ruby/bin/gem sources -c but that did not resolve the problems.
Why doesn't homebrew's gem install the newest version of docker-sync? Why does homebrew's gem produce the error when I try to update the old version of docker-sync?