1

After running whenever -i in log files is see this messages. What should i do to fix this problem?

cut: /link/to/my/project/.ruby-version: Operation not permitted
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229:in ``': Operation not permitted - getcwd (Errno::EPERM)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229:in `<module:RbConfig>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:11:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:9:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:9:in `<top (required)>'
    from <internal:gem_prelude>:2:in `require'
    from <internal:gem_prelude>:2:in `<internal:gem_prelude>'
GRVPrasad
  • 1,228
  • 1
  • 9
  • 24

1 Answers1

1

The file .ruby-version is a pattern from rvm. I think a few other ruby installers might use this pattern too and this file shouldn't be checked into the repo as it's specific to a developer's environment, but it tells rvm to switch the version of ruby. Given that's where this message is being thrown this message would indicate to me this looks like a permissions issue with your installed ruby or with whenever gem itself in your environment.

engineerDave
  • 3,887
  • 26
  • 28
  • Both rvm and rbenv use `.ruby-version`. "as it's specific to a developer's environment" - nope. Hopefully your development enviroment, production, testing and your colleges are running the exact same ruby version. If not your setting yourself up for a really bad day. See https://stackoverflow.com/questions/32934651/is-it-a-bad-practice-to-list-ruby-version-in-both-gemfile-and-ruby-version-dotf – max Feb 07 '20 at 17:18
  • I work alone so i think this is not problem for now. But removing .ruby-version did't help to resolve problem. – Ilyas Aliyev Feb 07 '20 at 17:33
  • I agree with max. For best results, check in `.ruby-version` into version control. – Marlin Pierce Feb 07 '20 at 18:33
  • After removing .ruby-version file log file shows this messages /Users/ilyasaliyev/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:85:in `pwd': Operation not permitted - getcwd (Errno::EPERM) – Ilyas Aliyev Feb 07 '20 at 19:07