oneclick / rubyinstaller2

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

Bundler::GemNotFound when executing jekyll #276

Closed HolySearch closed 2 years ago

HolySearch commented 2 years ago

What problems are you experiencing?

When trying to execute Jekyll commands it fails with a Bundler::GemNotFound error and a big list of unmet dependencies. Executing gem install jekyll bundler outputs a successful install, but jekyll -v fails.

It's probably the same problem as #261 and #262, but i'm not sure, so submitting a new issue.

Stacktrace from jekyll command:

C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.12/lib/bundler/definition.rb:481:in materialize': Could not find github-pages-214, rouge-3.26.0, github-pages-health-check-1.17.0, jekyll-3.9.0, jekyll-avatar-0.7.0, jekyll-coffeescript-1.1.1, jekyll-commonmark-ghpages-0.1.6, jekyll-default-layout-0.1.4, jekyll-feed-0.15.1, jekyll-gist-1.5.0, jekyll-github-metadata-2.13.0, jekyll-mentions-1.6.0, jekyll-optional-front-matter-0.3.2, jekyll-paginate-1.1.0, jekyll-readme-index-0.3.0, jekyll-redirect-from-0.16.0, jekyll-relative-links-0.6.1, jekyll-remote-theme-0.4.3, jekyll-sass-converter-1.5.2, jekyll-seo-tag-2.7.1, jekyll-sitemap-1.4.0, jekyll-swiss-1.0.0, jekyll-theme-architect-0.1.1, jekyll-theme-cayman-0.1.1, jekyll-theme-dinky-0.1.1, jekyll-theme-hacker-0.1.2, jekyll-theme-leap-day-0.1.1, jekyll-theme-merlot-0.1.1, jekyll-theme-midnight-0.1.1, jekyll-theme-minimal-0.1.1, jekyll-theme-modernist-0.1.1, jekyll-theme-primer-0.5.4, jekyll-theme-slate-0.1.1, jekyll-theme-tactile-0.1.1, jekyll-theme-time-machine-0.1.1, jekyll-titles-from-headings-0.5.3, jemoji-0.12.0, kramdown-2.3.1, mercenary-0.3.6, minima-2.5.1, nokogiri-1.11.3, terminal-table-1.8.0, addressable-2.7.0, dnsruby-1.61.5, octokit-4.20.0, public_suffix-4.0.6, typhoeus-1.4.0, em-websocket-0.5.2, i18n-0.9.5, coffee-script-2.4.1, coffee-script-source-1.11.1, commonmarker-0.17.13, jekyll-commonmark-1.3.1, html-pipeline-2.14.0, rubyzip-2.3.0, sass-3.7.4, gemoji-3.0.1, mini_portile2-2.5.0, racc-1.5.2, unicode-display_width-1.7.0, simpleidn-0.2.1, faraday-1.3.0, sawyer-0.8.2, ethon-0.13.0, http_parser.rb-0.6.0, concurrent-ruby-1.1.8, listen-3.5.1, execjs-2.7.0, ruby-enum-0.9.0, activesupport-6.0.3.6, sass-listen-4.0.0, unf-0.1.4, faraday-net_http-1.0.1, multipart-post-2.1.1, ruby2_keywords-0.0.4, ffi-1.15.0, rb-fsevent-0.10.4, minitest-5.14.4, tzinfo-1.2.9, zeitwerk-2.4.2, unf_ext-0.0.7.7, thread_safe-0.3.6 in any of the sources (Bundler::GemNotFound) from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.12/lib/bundler/definition.rb:190:inspecs' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.12/lib/bundler/definition.rb:238:in specs_for' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.12/lib/bundler/runtime.rb:18:insetup' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.12/lib/bundler.rb:151:in setup' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/plugin_manager.rb:52:inrequire_from_bundler' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/exe/jekyll:11:in <top (required)>' from C:/Ruby31-x64/bin/jekyll:32:inload' from C:/Ruby31-x64/bin/jekyll:32:in `

'

Steps to reproduce

Download & execute rubyinstaller-devkit-3.1.2-1-x64.exe Use all default options for installation After installation, open a CMD with Ruby and run gem install jekyll bundler Then try to check Jekyll version with jekyll -v Result is the preceding stacktrace

What's the output from ridk version?

bash.exe: warning: could not find /tmp, please create! --- ruby: path: C:/Ruby31-x64 version: 3.1.2 platform: x64-mingw-ucrt ruby_installer: package_version: 3.1.2-1 git_commit: 17502f9 msys2: path: C:\Ruby31-x64\msys64 cc: gcc (Rev10, Built by MSYS2 project) 11.2.0 sh: GNU bash, versão 5.1.16(1)-release (x86_64-pc-msys) os: Microsoft Windows [vers�o 10.0.19044.1645]

mohits commented 2 years ago

@HolySearch - Are you using bash.exe? Could you try the Windows command prompt to just confirm if the problem is running under bash or even under the Windows command prompt? Thanks!

By the way, the error reads:

could not find /tmp, please create!

I guess you need a tmp folder?

HolySearch commented 2 years ago

@mohits i'm not using bash, the stacktraces i posted are from the cmd with Ruby. In bash i get a permission error when trying the described steps.

Also, where should i create the /tmp folder?

mohits commented 2 years ago

Hi @HolySearch - Sorry for the delay in replying because I wanted to follow exactly what you did on a clean installation of Ruby 3.1 (3.1.1 actually). So far, I have done this:

[1] Install Ruby 3.1 using the instructions as here: https://notepad.onghu.com/2022/ruby3.1-windows-day0-install-hello_world/

[2] Installed Jekyll using gem install jekyll bundler

<snip>
Done installing documentation for unicode-display_width, terminal-table, safe_yaml, rouge, forwardable-extended, pathutil, mercenary, liquid, kramdown, kramdown-parser-gfm, ffi, rb-inotify, rb-fsevent, listen, jekyll-watch, sassc, jekyll-sass-converter, concurrent-ruby, i18n, http_parser.rb, eventmachine, em-websocket, colorator, public_suffix, addressable, jekyll after 41 seconds
Fetching bundler-2.3.12.gem
Successfully installed bundler-2.3.12
Parsing documentation for bundler-2.3.12
Installing ri documentation for bundler-2.3.12
Done installing documentation for bundler after 0 seconds
27 gems installed

[3] Then, I did jekyll -v and this is what I get.

$ jekyll -v
jekyll 4.2.2

Since it works for me, it makes it tougher to debug :) but let's try. I have 1 questions from this:

I got loads more errors when I ran jekyll -v in an existing Jekyll setup.

Resolving dependencies...
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.12/lib/bundler/resolver.rb:57:in `rescue in start': Bundler could not find compatible versions for gem "ffi": (Bundler::VersionConflict)
  In snapshot (Gemfile.lock):
    ffi (= 1.15.1)

  In Gemfile:
    jekyll was resolved to 4.2.0, which depends on
      jekyll-sass-converter (~> 2.0) was resolved to 2.1.0, which depends on
        sassc (> 2.0.1, < 3.0) was resolved to 2.4.0, which depends on
          ffi (~> 1.9)
HolySearch commented 2 years ago

After you asked, I tried on my user folder (C:\Users\user) and Jekyll worked properly, so I proceeded to update the Gemfile and Gemfile.lock for the project, then getting similar errors you got. Further searching revealed it's a problem with Jekyll https://github.com/jekyll/jekyll/issues/8523

Thank you for your support, @mohits