Homebrew-cask: brew cask style failed

Created on 3 Oct 2018  ·  41Comments  ·  Source: Homebrew/homebrew-cask

General troubleshooting steps

Description of issue

{{Whenever I try to use brew cask style' orcask-repair` both come back with some error}}

Command that failed

{{brew cask style}} {{cask-repair}}

Output of command with --force --verbose --debug

{{Jacobs-MacBook-Air:~ jacobledbetter$ brew cask style --force --verbose --debug
Error: invalid option: --force
/usr/local/Homebrew/Library/Homebrew/cask/cmd/options.rb:63:in `process_arguments'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:41:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:143:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'}}

Output of brew cask doctor

{{Jacobs-MacBook-Air:~ jacobledbetter$ brew cask doctor
==> Homebrew Version
1.7.6-70-g8f03ea7
==> macOS
10.14
==> SIP
Enabled
==> Java
11
==> Gatekeeper support
Enabled
==> Homebrew Cask Install Location
<NONE>
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (4036 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (204 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-eid (11 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (1177 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (152 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-macho-2.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/plist-3.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/backports-3.11.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/activesupport-5.2.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/tzinfo-1.2.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/minitest-5.11.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/i18n-1.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib
/Library/Ruby/Gems/2.3.0/gems/did_you_mean-1.0.0/lib
/Library/Ruby/Site/2.3.0
/Library/Ruby/Site/2.3.0/x86_64-darwin18
/Library/Ruby/Site/2.3.0/universal-darwin18
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/universal-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/x86_64-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/bin/bash"}}

Output of brew tap

{{Jacobs-MacBook-Air:~ jacobledbetter$ brew tap
homebrew/cask
homebrew/cask-drivers
homebrew/cask-eid
homebrew/cask-fonts
homebrew/cask-versions
homebrew/core
vitorgalvao/tiny-scripts}}
bug outdated stale

Most helpful comment

For those who still have issues with this as I did. I did this: https://github.com/Homebrew/brew/issues/4998#issuecomment-425566799 and it fixed it for me.

All 41 comments

I'm facing the same issue. I'll add the output of the --debug flag:

$ brew cask style --debug
Ignoring jaro_winkler-1.5.1 because its extensions are not built.  Try: gem pristine jaro_winkler --version 1.5.1
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- jaro_winkler (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop/string_util.rb:3:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop.rb:21:in `require_relative'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop.rb:21:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/exe/rubocop:6:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in `load'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in `<main>'
Error: style check failed
/usr/local/Homebrew/Library/Homebrew/cask/cmd/style.rb:15:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'
Error: Kernel.exit
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `exit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in `rescue in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:143:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in `<main>'

Thx

Same 😞
~~~ sh

cmd brew cask style --debug
Ignoring jaro_winkler-1.5.1 because its extensions are not built. Try: gem pristine jaro_winkler --version 1.5.1
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- jaro_winkler (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.1/lib/rubocop/string_util.rb:3:in <top (required)>' from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.1/lib/rubocop.rb:21:inrequire_relative'
from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.1/lib/rubocop.rb:21:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.1/exe/rubocop:6:in from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in load' from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in

'
Error: style check failed
/usr/local/Homebrew/Library/Homebrew/cask/cmd/style.rb:15:in run' /usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:inrun'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in run_command' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:inrun'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in run' /usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:incask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in <main>' Error: Kernel.exit /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:inexit'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:160:in rescue in run' /usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:143:inrun'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in run' /usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:incask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:91:in <main>' ~~~ thengem pristine jaro_winkler --version 1.5.1` doesn't fix it as suggested, either…

FYI, this comment fixed it. But that probably doesn't solve whatever was the root cause…

Probably a software update or Mojave

Didn't work for me

Please run:

brew update && brew cleanup (note cleanup will remove some cached files)

and try brew cask style again.

Sorry to say

Jacobs-Air:~ jacobledbetter$ brew cask style
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- jaro_winkler (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop/string_util.rb:3:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop.rb:21:in `require_relative'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop.rb:21:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/exe/rubocop:6:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in `load'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in `<main>'
Error: style check failed

Not sure why it solves it, but my go to fix lately has been to run:

brew vendor-install ruby

Wether if it's a good idea or not, I don't know, but at least is solves the issue temporarily.

Didn't work

So... does anyone have any idea what I can do?

Hi again,

Just had my own error about did_you_mean. Instead of applying my own suggestion, I searched my system Ruby, and I had some gems installed there. Removed the ones that came up as an error.

/usr/bin/gem --list

Except the jaro-winkler gem that brew needs to style is broken and I have no clue how to fix it

This issue also breaks CI server. Does anyone knows the root cause or how to fix it?

I have yet to determine what the root cause was, my first guess was my upgrade to Mojave.

I'm running it on High Sierra and got the same error, so I think it not only happened on Mojave.
Also, the CI server breaks down.

Huh, weird

I found the way to fix cask-repair.
Open cask-repair which located in /usr/local/bin on my machine.
Change line #502 from

style_message=$(brew cask style --fix "${cask_file}" 2>/dev/null)

to

style_message=$(brew cask style --fix "${cask_name}" 2>/dev/null)

The difference between cask_file and cask_name is that cask_file have the .rb postfix.
It seems brew cask style changed the meaning of input parameter, so when running brew cask style --fix "${cask_name} now checks no cask - and that's an error for the flow and keep asking you to fix it.

However, since the CI server also break because of brew cask style, I'm not sure this should be fixed in cask-repair. Further more, this issue on CI server seems to be fixed, maybe brew cask style fixed it's behavior?

Updated:
I think brew cask style has fixed this issue. See https://github.com/Homebrew/brew/commit/a838b372de19581dd21484b797e87dcf6466ebb7#diff-434a752265eb1d125f34b2594587abac
So no change needed to cask-repair.

Even after brew update, brew cask style still fails for me, as does cask-repair.

brew cask style

$ cd "$(brew --repository)"/Library/Taps/Homebrew/homebrew-cask
$ brew cask style Casks/oxygen-xml-editor.rb 
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- jaro_winkler (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop/string_util.rb:3:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop.rb:21:in `require_relative'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/lib/rubocop.rb:21:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/rubocop-0.59.2/exe/rubocop:6:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in `load'
    from /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/bin/rubocop:22:in `<main>'
Error: style check failed
Joes-MacBook-Pro-13-PAHO:homebrew-cask joe$ brew cask style Casks/oxygen-xml-editor
Error: Cask 'oxygen-xml-editor' is unavailable: No Cask with this name exists. Did you mean “oxygen-xml-editor ✔”?

cask-repair

$ cask-repair oxygen-xml-editor
Updating taps… Already up-to-date.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cask 'oxygen-xml-editor' do
  version :latest
  sha256 :no_check

  url 'http://mirror.oxygenxml.com/InstData/Editor/MacOSX/VM/oxygen.dmg'
  name 'oXygen XML Editor'
  homepage 'https://www.oxygenxml.com/xml_editor.html'

  suite 'Oxygen XML Editor'
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Type the new version (or leave blank to use current one, or use `s` to skip)
> 
Paste the new URL (or leave blank to use the current one)
> https://www.oxygenxml.com/InstData/Editor/MacOSX/VM/oxygen.dmg
diff --git a/Casks/oxygen-xml-editor.rb b/Casks/oxygen-xml-editor.rb
index c05dd2b6b..230f73b8c 100644
--- a/Casks/oxygen-xml-editor.rb
+++ b/Casks/oxygen-xml-editor.rb
@@ -2,7 +2,7 @@ cask 'oxygen-xml-editor' do
   version :latest
   sha256 :no_check

-  url 'http://mirror.oxygenxml.com/InstData/Editor/MacOSX/VM/oxygen.dmg'
+  url 'https://www.oxygenxml.com/InstData/Editor/MacOSX/VM/oxygen.dmg'
   name 'oXygen XML Editor'
   homepage 'https://www.oxygenxml.com/xml_editor.html'

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
• 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is everything correct? ([y]es / [n]o / [e]dit) y
diff --git a/Casks/oxygen-xml-editor.rb b/Casks/oxygen-xml-editor.rb
index c05dd2b6b..230f73b8c 100644
--- a/Casks/oxygen-xml-editor.rb
+++ b/Casks/oxygen-xml-editor.rb
@@ -2,7 +2,7 @@ cask 'oxygen-xml-editor' do
   version :latest
   sha256 :no_check

-  url 'http://mirror.oxygenxml.com/InstData/Editor/MacOSX/VM/oxygen.dmg'
+  url 'https://www.oxygenxml.com/InstData/Editor/MacOSX/VM/oxygen.dmg'
   name 'oXygen XML Editor'
   homepage 'https://www.oxygenxml.com/xml_editor.html'

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
• 
• 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Is everything correct? ([y]es / [n]o / [e]dit) ^C
You aborted.

I think thats different issue. In your case, the problem seems missing the gem jaro_winkler which is required by rubocop.

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- jaro_winkler (LoadError)

Maybe you should check if this gem installed, or try to reinstall it again and see if it works?

Please stop discussing cask-repair in this context, as it only fills the issue with irrelevant information, making it harder to parse. cask-repair uses brew cask style directly, so it’s natural that if the latter fails, so does the former; and you fix the former by fixing the latter. There’s nothing wrong with cask-repair.

Noted, now the question is how do we fix brew cask style?

Maybe you should check if this gem installed, or try to reinstall it again and see if it works?

I beg your forgiveness, but I'm gem-illiterate. Could you suggest some specific commands that I should run? I've updated & upgraded homebrew, and brew doctor says I'm ready to brew. But brew cask style fails with the jaro_winkler error quoted above. I'd be happy to try your suggestions and will report back with my results.

Here are some attempts to answer the question about if I have jaro_winkler installed (no, it appears). As you can tell, I am not a ruby user - I just use homebrew and thus depend on brew cask style.

$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.8)
CFPropertyList (2.2.8)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3.1)
libxml-ruby (2.9.0)
minitest (5.8.5)
net-telnet (0.1.1)
nokogiri (1.5.6)
power_assert (0.2.6)
psych (2.1.0.1)
rake (10.4.2)
rdoc (4.2.1)
sqlite3 (1.3.11)
test-unit (3.1.5)

$ gem install jaro_winkler
Fetching: jaro_winkler-1.5.1.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

$ brew search rubocop
No formula or cask found for "rubocop".

$ gem install rubocop
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

Try sudo?

On Mon, Oct 22, 2018, 1:49 PM Joe Wicentowski notifications@github.com
wrote:

Here are some attempts to answer the question about if I have jaro_winkler
installed (no, it appears). As you can tell, I am not a ruby user - I just
use homebrew and thus depend on brew cask style.

$ gem list
* LOCAL GEMS *

bigdecimal (1.2.8)
CFPropertyList (2.2.8)
did_you_mean (1.0.0)
io-console (0.4.5)
json (1.8.3.1)
libxml-ruby (2.9.0)
minitest (5.8.5)
net-telnet (0.1.1)
nokogiri (1.5.6)
power_assert (0.2.6)
psych (2.1.0.1)
rake (10.4.2)
rdoc (4.2.1)
sqlite3 (1.3.11)
test-unit (3.1.5)

$ gem install jaro_winkler
Fetching: jaro_winkler-1.5.1.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.$ brew search rubocopNo formula or cask found for "rubocop".$ gem install rubocopERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Homebrew/homebrew-cask/issues/52775#issuecomment-431956649,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AV-IdqJwQ--G2G6OAWFr0O9KWVyxxY66ks5uniE8gaJpZM4XGJt_
.

So uninstalling and reinstalling brew fixed it...

@CryoRenegade I just tried that myself, but had no luck. brew style and brew cask style still error out: "Error installing rubocop: ERROR: Failed to build gem native extension...", with the same telltale mentions of jaro_winkler. It looks like https://github.com/Homebrew/brew/issues/4894 might help if that issue is addressed. (I can confirm that I updated after https://github.com/Homebrew/brew/pull/5190 was merged and am still hitting this issue with brew style and brew cask style.)

p.s. I'm holding out for a solution that doesn't involve sudo - and ideally one that would "just work" for me with a fresh, clean installation of homebrew.

If you don't want to deal with sudo, then you should not use ruby built in system.

You can use rvm or rbenv to install independent ruby environment, which install all ruby gems in your $HOME, so you won't encounter any permission problem anymore.

I should also mention I tried brew install ruby and applied the suggested command to add the homebrew ruby to my PATH variable via .bash_profile and sourced the .bash_profile, but still got the same error.

$ brew style
==> Installing or updating 'rubocop' gem
Building native extensions. This could take a while...
ERROR: Error installing rubocop:
ERROR: Failed to build gem native extension.

current directory: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181108-63356-ev02gx.rb extconf.rb
creating Makefile

current directory: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
make "DESTDIR=" clean

current directory: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
make "DESTDIR="
make: * No rule to make target /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed byadj_matrix.o'. Stop.

make failed, exit code 2

Gem files will remain installed in /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1 for inspection.
Results logged to /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.1/gem_make.out
Error: Failed to install/update the 'rubocop' gem.

I hate to sound curmudgeonly, but shouldn't brew's own utilities like brew style "just work" once you've installed homebrew? Or if a dependency is needed, it should tell me what I need to do. This is one of the greatest things about homebrew - it tries to help you with brew doctor and helpful messages. Short of that, I am reluctant to add more dependencies to something -- that is supposed to be my package manager, after all. Perhaps I've done something wrong, and I'm totally willing to troubleshoot and report back. But a bunch of people here hit this problem, and I'm sure there are others who are less vocal or who just gave up on the idea. Hopefully the links I pasted in to my note earlier tonight suggest that homebrew will be taking on more of the task of integrating the needed tools.

I'm still running into this issue as well. I cannot cask-repair zeplin. I've tried every suggestion in this thread and the various linked comments to no avail.

I have the same issue during installation

brew cask style --fix                                                                                                                                                                                    917ms  Mon 12 Nov 12:05:23 2018
==> Installing or updating 'rubocop-cask' gem
Building native extensions.  This could take a while...
ERROR:  Error installing rubocop-cask:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181112-18891-13cafer.rb extconf.rb
creating Makefile

current directory: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
make "DESTDIR=" clean

current directory: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1/ext/jaro_winkler
make "DESTDIR="
make: *** No rule to make target `/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `adj_matrix.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/gems/jaro_winkler-1.5.1 for inspection.
Results logged to /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.1/gem_make.out
Error: Failed to install/update the 'rubocop-cask' gem.

For those who still have issues with this as I did. I did this: https://github.com/Homebrew/brew/issues/4998#issuecomment-425566799 and it fixed it for me.

@LanikSJ Thank you, your solution worked for me too! Just brew vendor-install ruby and suddenly brew style and brew cask style work! Ah, I'm so relieved and glad I can once again contribute to caskroom.

@MikeMcQuaid Does this suggest a solution to https://github.com/Homebrew/brew/issues/4894, https://github.com/Homebrew/brew/issues/4998, and https://github.com/Homebrew/brew/pull/5190?

This fixed it for me as well @LanikSJ.

One thing to note is I've had to do brew vendor-install ruby a few times before running brew cask style.

Before brew vendor-install ruby:

○ → brew cask doctor
==> Homebrew Version
1.8.3-4-g7241156
==> macOS
10.14.1
==> SIP
Enabled
==> Java
N/A
==> Gatekeeper support
Enabled
==> Homebrew Cask Install Location
<NONE>
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (4062 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (209 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-eid (11 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (1184 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (157 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-macho-2.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rubocop-0.60.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/unicode-display_width-1.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-progressbar-1.10.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rainbow-3.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/powerpack-0.1.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/plist-3.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/parser-2.5.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/parallel-1.12.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/jaro_winkler-1.5.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.1
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/backports-3.11.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ast-2.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/activesupport-5.2.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/tzinfo-1.2.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/minitest-5.11.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/i18n-1.1.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib
/Library/Ruby/Gems/2.3.0/gems/did_you_mean-1.0.0/lib
/Library/Ruby/Site/2.3.0
/Library/Ruby/Site/2.3.0/x86_64-darwin18
/Library/Ruby/Site/2.3.0/universal-darwin18
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/universal-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/x86_64-darwin18
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin18
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/local/Homebrew/Library/Homebrew/shims/scm:/usr/bin:/bin:/usr/sbin:/sbin"
SHELL="/usr/local/bin/bash"

After running brew vendor-install ruby:

○ → brew cask doctor
==> Homebrew Version
1.8.3-4-g7241156
==> macOS
10.14.1
==> SIP
Enabled
==> Java
N/A
==> Gatekeeper support
Enabled
==> Homebrew Cask Install Location
<NONE>
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (4062 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions (209 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-eid (11 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (1184 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (157 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-macho-2.1.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rubocop-rspec-1.30.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rubocop-0.60.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/unicode-display_width-1.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ruby-progressbar-1.10.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/rainbow-3.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/powerpack-0.1.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/plist-3.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/parser-2.5.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/parallel-1.12.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/jaro_winkler-1.5.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.1
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/backports-3.11.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/ast-2.4.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/activesupport-5.2.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/tzinfo-1.2.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/minitest-5.11.3/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/i18n-1.1.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/../ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/site_ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/vendor_ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/local/Homebrew/Library/Homebrew/shims/scm:/usr/bin:/bin:/usr/sbin:/sbin"
SHELL="/usr/local/bin/bash"

Seems like the vendor-install method is fixing it for most users, so closing.

This is actually a bug in Mojave, so I'll reopen this as a tracking issue.

https://openradar.appspot.com/46465917
https://openradar.appspot.com/46487252

Thank you @reitermarkus .

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings