Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError #361

Open
patrick-melo opened this issue Jun 19, 2023 · 1 comment
Open

PermissionError #361

patrick-melo opened this issue Jun 19, 2023 · 1 comment

Comments

@patrick-melo
Copy link

I get a permission error when I try to run jekyll new with the latest image (4.2.2).

% docker run --platform linux/amd64 --volume="$PWD:/srv/jekyll" -it jekyll/jekyll:latest jekyll new docs
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
Running bundle install in /srv/jekyll/docs... 
Bundler: Fetching gem metadata from https://rubygems.org/............
Bundler: Resolving dependencies...
Bundler: Using bundler 2.3.25
Bundler: Using colorator 1.1.0
Bundler: Fetching public_suffix 5.0.1
Bundler: Fetching concurrent-ruby 1.2.2
Bundler: Using eventmachine 1.2.7
Bundler: Using http_parser.rb 0.8.0
Bundler: Using ffi 1.15.5
Bundler: Using forwardable-extended 2.6.0
Bundler: Using rb-fsevent 0.11.2
Bundler: Using rexml 3.2.5
Bundler: Fetching liquid 4.0.4
Bundler: Using mercenary 0.4.0
Bundler: Using rouge 3.30.0
Bundler: Using safe_yaml 1.0.5
Bundler: Using unicode-display_width 1.8.0
Bundler: Using em-websocket 0.5.3
Bundler: Using sassc 2.4.0
Bundler: Using rb-inotify 0.10.1
Bundler: Using pathutil 0.16.2
Bundler: Using kramdown 2.4.0
Bundler: Using terminal-table 2.0.0
Bundler: Using jekyll-sass-converter 2.2.0
Bundler: Fetching listen 3.8.0
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: 
Bundler: Using kramdown-parser-gfm 1.1.0Retrying download gem from https://rubygems.org/ due to error (2/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/concurrent-ruby-1.2.2.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (2/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/liquid-4.0.4.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (3/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/concurrent-ruby-1.2.2.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (2/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/public_suffix-5.0.1.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (2/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/listen-3.8.0.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (4/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/concurrent-ruby-1.2.2.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (3/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/liquid-4.0.4.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (3/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/public_suffix-5.0.1.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (3/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/listen-3.8.0.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (4/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/liquid-4.0.4.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (4/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/public_suffix-5.0.1.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Retrying download gem from https://rubygems.org/ due to error (4/4): Bundler::PermissionError There was an error while trying to write to `/usr/gem/cache/listen-3.8.0.gem`. It is likely that you need to grant write permissions for that path.
Bundler: Bundler::PermissionError: There was an error while trying to write to
Bundler: `/usr/gem/cache/public_suffix-5.0.1.gem`. It is likely that you need to grant
Bundler: write permissions for that path.
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/shared_helpers.rb:105:in
Bundler: `rescue in filesystem_access'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/shared_helpers.rb:102:in
Bundler: `filesystem_access'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/rubygems_integration.rb:483:in
Bundler: `block in download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/retry.rb:40:in
Bundler: `run'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/retry.rb:30:in
Bundler: `attempt'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/rubygems_integration.rb:474:in
Bundler: `download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:539:in
Bundler: `download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:488:in
Bundler: `fetch_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:465:in
Bundler: `fetch_gem_if_possible'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:158:in
Bundler: `install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/gem_installer.rb:54:in
Bundler: `install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/gem_installer.rb:16:in
Bundler: `install_from_spec'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/parallel_installer.rb:186:in
Bundler: `do_install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/parallel_installer.rb:177:in
Bundler: `block in worker_pool'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:62:in
Bundler: `apply_func'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:57:in
Bundler: `block in process_queue'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:54:in
Bundler: `loop'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:54:in
Bundler: `process_queue'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:91:in
Bundler: `block (2 levels) in create_threads'
Bundler: 
Bundler: An error occurred while installing public_suffix (5.0.1), and Bundler cannot
Bundler: continue.
Bundler: 
Bundler: In Gemfile:
Bundler: minima was resolved to 2.5.1, which depends on
Bundler: jekyll-feed was resolved to 0.17.0, which depends on
Bundler: jekyll was resolved to 4.2.2, which depends on
Bundler: addressable was resolved to 2.8.4, which depends on
Bundler: public_suffix
Bundler: 
Bundler: 
Bundler: Bundler::PermissionError: There was an error while trying to write to
Bundler: `/usr/gem/cache/concurrent-ruby-1.2.2.gem`. It is likely that you need to grant
Bundler: write permissions for that path.
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/shared_helpers.rb:105:in
Bundler: `rescue in filesystem_access'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/shared_helpers.rb:102:in
Bundler: `filesystem_access'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/rubygems_integration.rb:483:in
Bundler: `block in download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/retry.rb:40:in
Bundler: `run'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/retry.rb:30:in
Bundler: `attempt'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/rubygems_integration.rb:474:in
Bundler: `download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:539:in
Bundler: `download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:488:in
Bundler: `fetch_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:465:in
Bundler: `fetch_gem_if_possible'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:158:in
Bundler: `install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/gem_installer.rb:54:in
Bundler: `install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/gem_installer.rb:16:in
Bundler: `install_from_spec'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/parallel_installer.rb:186:in
Bundler: `do_install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/parallel_installer.rb:177:in
Bundler: `block in worker_pool'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:62:in
Bundler: `apply_func'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:57:in
Bundler: `block in process_queue'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:54:in
Bundler: `loop'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:54:in
Bundler: `process_queue'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:91:in
Bundler: `block (2 levels) in create_threads'
Bundler: 
Bundler: An error occurred while installing concurrent-ruby (1.2.2), and Bundler cannot
Bundler: continue.
Bundler: 
Bundler: In Gemfile:
Bundler: minima was resolved to 2.5.1, which depends on
Bundler: jekyll-feed was resolved to 0.17.0, which depends on
Bundler: jekyll was resolved to 4.2.2, which depends on
Bundler: i18n was resolved to 1.14.1, which depends on
Bundler: concurrent-ruby
Bundler: 
Bundler: 
Bundler: Bundler::PermissionError: There was an error while trying to write to
Bundler: `/usr/gem/cache/liquid-4.0.4.gem`. It is likely that you need to grant write
Bundler: permissions for that path.
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/shared_helpers.rb:105:in
Bundler: `rescue in filesystem_access'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/shared_helpers.rb:102:in
Bundler: `filesystem_access'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/rubygems_integration.rb:483:in
Bundler: `block in download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/retry.rb:40:in
Bundler: `run'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/retry.rb:30:in
Bundler: `attempt'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/rubygems_integration.rb:474:in
Bundler: `download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:539:in
Bundler: `download_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:488:in
Bundler: `fetch_gem'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:465:in
Bundler: `fetch_gem_if_possible'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/source/rubygems.rb:158:in
Bundler: `install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/gem_installer.rb:54:in
Bundler: `install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/gem_installer.rb:16:in
Bundler: `install_from_spec'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/parallel_installer.rb:186:in
Bundler: `do_install'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/installer/parallel_installer.rb:177:in
Bundler: `block in worker_pool'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:62:in
Bundler: `apply_func'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:57:in
Bundler: `block in process_queue'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:54:in
Bundler: `loop'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:54:in
Bundler: `process_queue'
Bundler: /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/lib/bundler/worker.rb:91:in
Bundler: `block (2 levels) in create_threads'
Bundler: 
Bundler: An error occurred while installing liquid (4.0.4), and Bundler cannot continue.
Bundler: 
Bundler: In Gemfile:
Bundler: minima was resolved to 2.5.1, which depends on
Bundler: jekyll-feed was resolved to 0.17.0, which depends on
Bundler: jekyll was resolved to 4.2.2, which depends on
Bundler: liquid
% 
@patrick-melo
Copy link
Author

patrick-melo commented Jun 19, 2023

This seemed to fix the permission issue:

docker run --platform linux/amd64 --volume "$PWD:/srv/jekyll" -it jekyll/jekyll:latest /bin/bash -c "chmod -R 777 /usr/gem ; jekyll new docs"

When I run the serve command however, I get another error.

% docker run --platform linux/amd64 --volume="$PWD:/srv/jekyll" -it -p 4000:4000 jekyll/jekyll jekyll serve
Fetching gem metadata from https://rubygems.org/...........
Using bundler 2.3.25
Fetching public_suffix 5.0.1
Using colorator 1.1.0
Fetching concurrent-ruby 1.2.2
Installing public_suffix 5.0.1
Installing concurrent-ruby 1.2.2
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using ffi 1.15.5
Using forwardable-extended 2.6.0
Using rb-fsevent 0.11.2
Using rexml 3.2.5
Fetching liquid 4.0.4
Using mercenary 0.4.0
Using rouge 3.30.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.8.0
Fetching addressable 2.8.4
Installing liquid 4.0.4
Using em-websocket 0.5.3
Using sassc 2.4.0
Using rb-inotify 0.10.1
Using pathutil 0.16.2
Using kramdown 2.4.0
Fetching i18n 1.14.1
Installing addressable 2.8.4
Using terminal-table 2.0.0
Using jekyll-sass-converter 2.2.0
Fetching listen 3.8.0
Installing i18n 1.14.1
Using kramdown-parser-gfm 1.1.0
Installing listen 3.8.0
Using jekyll-watch 2.2.1
Using jekyll 4.2.2
Using jekyll-feed 0.17.0
Using jekyll-seo-tag 2.8.0
Using minima 2.5.1
Bundle complete! 7 Gemfile dependencies, 31 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
Configuration file: /srv/jekyll/_config.yml
            Source: /srv/jekyll
    Destination: /srv/jekyll/_site
Incremental build: disabled. Enable with --incremental
    Generating... 
    Jekyll Feed: Generating feed for posts
                    done in 1.498 seconds.
Auto-regeneration: enabled for '/srv/jekyll'
                    ------------------------------------------------
    Jekyll 4.2.2   Please append `--trace` to the `serve` command 
                    for any additional information or backtrace. 
                    ------------------------------------------------
/usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `require_relative'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `setup'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:100:in `process'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `each'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
    from /usr/gem/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
    from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
    from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
    from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
    from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
    from /usr/gem/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
    from /usr/gem/gems/jekyll-4.2.2/exe/jekyll:15:in `<top (required)>'
    from /usr/local/bundle/bin/jekyll:27:in `load'
    from /usr/local/bundle/bin/jekyll:27:in `<main>'
% 

These commands fix the second problem:

cd docs
docker run --platform linux/amd64 --volume="$PWD:/srv/jekyll" -it jekyll/jekyll bundle add webrick

Repository owner deleted a comment from htcrane Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant