Middleman Permission denied while installing thor (0.20.3), and Bundler cannot continue

153 Views Asked by At

I haven't touched my Middleman App for a few months and now it doesn't work. It seems like some dependencies are broken and that a gem is blocking everything.

Errno::EACCES: Permission denied @ rb_sysopen - 

/Users/<user>/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/.document
An error occurred while installing thor (0.20.3), and Bundler cannot continue.
Make sure that `gem install thor -v '0.20.3' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  middleman was resolved to 4.3.5, which depends on
    middleman-cli was resolved to 4.3.5, which depends on
      thor

If I try to install the gem 'thor -v '0.20.3', permission is denied:

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/<user>/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/.document

I tried gem cleanup thor, gem uninstall thor and all of that but nothing is fixing the problem.

Did anyone have this problem and found a way to fix it?

This is what my gemfile looks like:

source 'https://rubygems.org'

gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer', '~> 2.7'
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby, :x64_mingw]
gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw, :x64_mingw]
gem 'middleman-sprockets', '~> 4.0.0.rc'
gem 'sprockets-es6'
gem 'middleman-s3_sync'
gem 'middleman-livereload'
0

There are 0 best solutions below