github / opensourcefriday

🚲 Contribute to the open source community every Friday
https://opensourcefriday.com
MIT License
1.18k stars 157 forks source link

bundler: failed to load command: jekyll #1255

Closed asuender closed 3 months ago

asuender commented 1 year ago

Hello!

I just cloned this repo to start working on a German translation and I followed all instructions in README.md#development to install all dependencies. But when I try to run a local instance via ./script/server it fails:

❯ ./script/server
Configuration file: /Users/asuender/Documents/Coding/opensourcefriday/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
   GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
            Source: /Users/asuender/Documents/Coding/opensourcefriday
       Destination: /Users/asuender/Documents/Coding/opensourcefriday/_site
 Incremental build: enabled
      Generating... 
WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 49 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/borders.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 6 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/flexbox.scss
         from line 8 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 54 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/layout.scss
         from line 9 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 79 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/layout.scss
         from line 9 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 6 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/margin.scss
         from line 10 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 7 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/padding.scss
         from line 11 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 159 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/typography.scss
         from line 12 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 18 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/lib/visibility-display.scss
         from line 14 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-utilities/index.scss
         from line 4 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

WARNING: Unfortunately, no value could be retrieved from ``. Please make sure it is defined in `$breakpoints` map.
         on line 17 of /Users/asuender/Documents/Coding/opensourcefriday/node_modules/primer-support/lib/mixins/layout.scss, in `breakpoint'
         from line 6 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-layout/lib/grid-offset.scss
         from line 5 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/primer-layout/index.scss
         from line 5 of /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-theme-primer-0.6.0/_sass/jekyll-theme-primer.scss
         from line 1 of an unknown file

                    done in 1.92 seconds.
 Auto-regeneration: enabled for '/Users/asuender/Documents/Coding/opensourcefriday'
bundler: failed to load command: jekyll (/Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/bin/jekyll)
<internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- webrick (LoadError)
    from <internal:/opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:184:in `require_relative'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:184:in `setup'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:102:in `process'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:93:in `block in start'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:93:in `each'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:93:in `start'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/gems/jekyll-3.9.3/exe/jekyll:15:in `<top (required)>'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/bin/jekyll:25:in `load'
    from /Users/asuender/Documents/Coding/opensourcefriday/vendor/gems/ruby/3.2.0/bin/jekyll:25:in `<top (required)>'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/cli/exec.rb:58:in `load'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/cli/exec.rb:58:in `kernel_load'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/cli/exec.rb:23:in `run'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/cli.rb:491:in `exec'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/cli.rb:34:in `dispatch'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/cli.rb:28:in `start'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/exe/bundle:45:in `block in <top (required)>'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/exe/bundle:33:in `<top (required)>'
    from /opt/homebrew/lib/ruby/gems/3.2.0/bin/bundle:25:in `load'
    from /opt/homebrew/lib/ruby/gems/3.2.0/bin/bundle:25:in `<main>'

I managed to solve this by adding the webrick dependency to the Gemfile:

gem "webrick", "~> 1.8"

Or just:

bundle add webrick

I am new to Ruby & jekyll but shouldn't we add this to the Gemfile?

jonasermert commented 8 months ago

In this case, since you had to manually add the webrick gem to resolve the issue, it's a good idea to add it to the Gemfile so that others who clone the repository can easily install all dependencies by running bundle install. Including the specific version ("~> 1.8") in the Gemfile is also a good practice to avoid potential compatibility issues in the future.

You can open the Gemfile in a text editor and add the following line: gem "webrick", "~> 1.8"

After adding the line, save the Gemfile and run bundle install to ensure that the webrick gem is installed with the specified version.

ahpook commented 3 months ago

Thanks for the report, I've opened a PR for this addition.