Bundler / Middleman: Errno::EPERM: Operation not permitted @ apply2files (and Gem::FilePermissionError)

2k Views Asked by At

I'm trying to revive a Middleman app from 2014.

When I run bundle, I get the following:

Errno::EPERM: Operation not permitted @ apply2files -
/Users/josua/Documents/Work/MuheimWebdesign/welthaupt/src/vendor/bundle/ruby/2.6.0/gems/json-1.8.1/.gitignore
An error occurred while installing json (1.8.1), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.1' --source 'http://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  font-awesome-middleman was resolved to 4.1.1, which depends on
    middleman-core was resolved to 3.3.4, which depends on
      padrino-helpers was resolved to 0.12.2, which depends on
        padrino-support was resolved to 0.12.2, which depends on
          activesupport was resolved to 4.1.4, which depends on
            json

And when running gem install json -v '1.8.1' --source 'http://rubygems.org/', I get:

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

What's interesting is that when I run ruby -v, I get a different version than 2.6.0:

ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]

Could this be the problem? And if so, how can I make sure that the correct ruby is being used?

0

There are 0 best solutions below