rvm / executable-hooks

Other
21 stars 12 forks source link

Operation not permitted - /usr/bin/ruby_executable_hooks #24

Closed yakimant closed 6 years ago

yakimant commented 7 years ago
⇒  sudo gem install executable-hooks --bindir /usr/local/bin
Ignoring sqlite3-1.3.11 because its extensions are not built.  Try: gem pristine sqlite3 --version 1.3.11
Building native extensions.  This could take a while...
ERROR:  Error installing executable-hooks:
        ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.0.0/gems/executable-hooks-1.3.2/ext/wrapper_installer
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20170825-49278-rus3tb.rb extconf.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1381:in `initialize': Operation not permitted - /usr/bin/ruby_executable_hooks (Errno::EPERM)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1381:in `open'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1381:in `block in copy_file'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1380:in `open'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1380:in `copy_file'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:477:in `copy_file'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:394:in `block in cp'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1558:in `block in fu_each_src_dest'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1556:in `fu_each_src_dest'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:393:in `cp'
        from /Library/Ruby/Gems/2.0.0/gems/executable-hooks-1.3.2/lib/executable-hooks/wrapper.rb:52:in `install_from'
        from extconf.rb:18:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/executable-hooks-1.3.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/executable-hooks-1.3.2/gem_make.out
mpapis commented 7 years ago

is it about using wrong bindir?

yakimant commented 7 years ago

@mpapis, that is a weird moment here. I ask --bindir /usr/local/bin, but it tries /usr/bin/ anyway. (Other gems are fine, installing to /usr/local/bin

yakimant commented 7 years ago

I also have it in my ~/.gemrc: gem: --bindir /usr/local/bin --no-document

yakimant commented 7 years ago

As a workaround for this issue I disabled macOS "System Integrity Protection" and now able to write to /usr/bin/.

mpapis commented 7 years ago

I found it, it requires a bit of time, hope to get something to test for you around next weekend.

mpapis commented 6 years ago

finally got into fixing it, this can be tested with gem install executable-hooks -v 1.4.0.rc1