oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
654 stars 249 forks source link

Unable to build Jekyll site locally #204

Closed elizabethwarden closed 3 years ago

elizabethwarden commented 3 years ago

What problems are you experiencing?

I have followed the steps to download Ruby, Ruby Dev Kit, Bundler and Jekyll as listed here: https://rubyinstaller.org/downloads/. I am trying to run my Jekyll site locally, but keep running into the same error message after I enter the commands bundle update and bundle exec jekyll serve:

Configuration file: C:/[FILEPATH]/doc-standards-processes/_config.yml

  Jekyll 4.2.0   Please append `--trace` to the `serve` command
                 for any additional information or backtrace.

Steps to reproduce

1.Download Ruby, Ruby Dev Kit, Bundler and Jekyll as listed here: https://rubyinstaller.org/downloads/

  1. Open a Git Bash terminal and install the Jekyll gem with the command gem install jekyll.
  2. Install Bundler with the command gem install bundler.
  3. Initialize Bundler with the command bundle init.
  4. Open the newly created Gemfile in a text editor.
  5. Remove the contents of the file and replace them with the following: source "https://rubygems.org" gem 'wdm' gem 'jekyll'
  6. Save and close the file.
  7. Enter the command bundle install.
  8. Clone the repo from Git
  9. Right-click the local repo folder and select Git Bash Here.
  10. Enter the command bundle update.
  11. Enter the command bundle exec jekyll serve.

What's the output from ridk version?

bash: ridk: command not found

MSP-Greg commented 3 years ago

@elizabethwarden

This is not an issue with this repo (rubyinstaller2). It's messy, you might look at an old issue that I started in my Jekyll fork: https://github.com/MSP-Greg/jekyll/issues/1.

Please consider closing this and looking elsewhere for answers. One thing, I think all commands should be done from a Windows cmd or PowerShell window...

elizabethwarden commented 3 years ago

Thank you for the prompt response. I'll keep digging. Thank you

ashmaroli commented 3 years ago

@elizabethwarden Hello, I'm one of Jekyll's maintainers. I'm posting some notes here to help other users facing similar issue.

First of all, from the opening post, it isn't clear as to which version of Ruby you have installed. I'm assuming it is Ruby 3.0. If so, the error is most probably because webrick is no longer part of Ruby's library. You'll have to include gem 'webrick' as well in your Gemfile.

Secondly, you need not run bundle init and modify the Gemfile manually. Simply running jekyll new <PATH>, where <PATH> denotes the empty directory you wish to initialize as a Jekyll Workspace, will do. Just add the webrick gem manually to Gemfile in a subsequent step but prior to running bundle exec jekyll serve.

More info at https://jekyllrb.com/docs/

Lastly, the opening post above says ridk version couldn't be completed successfully. Therefore, did you run ridk install at the end of the Ruby installation process? Also, did bundle install run successfully? MSYS2 and other programs from the DevKit is required to install native dependencies while installing Jekyll.

elizabethwarden commented 3 years ago

@MSP-Greg Ruby version: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]

larskanis commented 3 years ago

@elizabethwarden Sorry I can't reproduce the issue with the information you provided!

  1. What is the error you've got?
  2. Could you provide some logs in addition to the commands? Copy and paste or screenshots.
  3. What does "9. Clone the repo from Git" mean? Is it a second Jekyll site? Something on github?
  4. Could you please try the commands in cmd or powershell? Bash isn't fully supported by RubyInstaller.
elizabethwarden commented 3 years ago

@ashmaroli I am not running Ruby 3.0. Should I? I'm on ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]

@larskanis

  1. Here's the error I'm getting when I run 'bundle exec jekyll serve'

Configuration file: C:/Users/Elizabeth Warden/Documents/Git/DocProcess/doc-standards-processes/_config.yml

  Jekyll 4.2.0   Please append `--trace` to the `serve` command
                 for any additional information or backtrace.
  1. C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/cache.rb:171:in load': marshal data too short (ArgumentError) from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/cache.rb:171:inload' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/cache.rb:86:in []' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/cache.rb:41:inclear_if_config_changed' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:118:in reset' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:35:ininitialize' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:in new' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:30:inprocess' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in block in process_with_graceful_fail' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:ineach' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in process_with_graceful_fail' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:inblock (2 levels) in init_with_program' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in block in execute' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:ineach' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in execute' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:ingo' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in program' from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/exe/jekyll:15:in<top (required)>' from C:/Ruby27-x64/bin/jekyll:23:in load' from C:/Ruby27-x64/bin/jekyll:23:in
    '
  2. We have our online help in a Jekyll SSG. In step 9, I was pulling the repo down from Git Hub
  3. Thank you all for the pro tip the GitBash isn't supported; I always use it. However, I get the same error in PowerShell

Thank you all for your help. At one point, I was able to build the Jekyll site locally, no problem. Then all of a sudden a few months ago - not sure what happened - but I was no longer able to build. I keep getting the same error that something is wrong with the _config.yml file and then all this stuff about Ruby in the log.

ashmaroli commented 3 years ago

@elizabethwarden No, you need not use Ruby 3.0 to run Jekyll. Ruby 2.7 is sufficient. From the stack trace, it is evident that the issue is not because of the RubyInstaller project.

The issue seems to be arising from your site's cache. You can try the following:

Since this isn't a RubyInstaller2 issue, you may close this ticket if possible. If the issue still persists after trying the above suggestions, I welcome you to open a ticket at https://github.com/jekyll/jekyll directly.

elizabethwarden commented 3 years ago

@ashmaroli Thank you for your help. I have tried all the solutions in this ticket and I'm still having the same error. I will fiddle around with this a bit more and will open a ticket with Jekyll directly. I appreciate all of your help!

kangnurrohman commented 2 years ago

@elizabethwarden No, you need not use Ruby 3.0 to run Jekyll. Ruby 2.7 is sufficient. From the stack trace, it is evident that the issue is not because of the RubyInstaller project.

The issue seems to be arising from your site's cache. You can try the following:

  • Delete the .jekyll-cache directory. Perhaps it wasn't created properly or contains corrupted data.
  • Bypass disk-caching entirely via either of the following:

    • by using the --disable-disk-cache option. i.e. run: bundle exec jekyll serve --disable-disk-cache
    • by having disable_disk_cache: true in your config file.

Since this isn't a RubyInstaller2 issue, you may close this ticket if possible. If the issue still persists after trying the above suggestions, I welcome you to open a ticket at https://github.com/jekyll/jekyll directly.

Big thanks