dinghy: Errors with fsevents_to_vm installation on setup
The FseventsToVm#install_if_necessary!
method effectively runs this command:
sudo -H /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/gem install --no-rdoc --no-ri -n /usr/local/bin fsevents_to_vm -v ~> 1.1.3
A couple of problems here,
-
The
VERSION
constant has a “~” ~which is expanded by the shell to my home directory, forming an invalid command. Changing this to a fixed version fixed this for me.~ -
The system version of the
gem install
command on Mac OS Sierra is from ruby 2.0. This is too old and causes problems when there are already any installed gem executables in /usr/local/bin, because ruby 2.0 doesn’t recognize the newer executable format installed by later rubies whenGem::Installer#check_executable_overwrite
inspects them:
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.4/thor.gemspec
Exception `NoMethodError' at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/package/tar_reader.rb:71 - undefined method `seek' for #<Zlib::GzipReader:0x007f92dd203bc8>
Exception `TypeError' at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:171 - no implicit conversion of nil into String
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/installer.rb:171:in `check_executable_overwrite'
(thor is a dependency that is already installed, and causing an error here.)
We could force-overwrite executables with gem install -f
, but maybe this is not the best solution. Does this need to be installed via the system version of rubygems or can we use a preferred version?
(e.g. brew installed ruby or ruby-install/chruby/rvm)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (6 by maintainers)
Oh I see what you mean, yeah that’s true. I mentioned the C extension only because it was the original reason to use rubygems in the first place (because it handles compiling C extensions on
gem install
), not because it’s directly causing this issue.Now that it’s not an issue, I’ve pulled fsevents_to_vm directly into Dinghy and everything seems to be working great. Upgrade to the latest Dinghy (v4.6.0) and it no longer uses rubygems at all, so this should be fixed. Let me know if you run into any issues and and hopefully we can close this out.