oneclick / rubyinstaller2

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

I've got an error while try installing jekyll on windows 10 #330

Closed JannyCAI closed 1 year ago

JannyCAI commented 1 year ago

C:\Users\Liuzf>gem install jekyll bundler Successfully installed ffi-1.15.5-x64-mingw-ucrt Successfully installed google-protobuf-3.21.12-x64-mingw-ucrt Successfully installed sass-embedded-1.57.1-x64-mingw-ucrt Successfully installed jekyll-4.3.1 Parsing documentation for ffi-1.15.5-x64-mingw-ucrt Parsing documentation for google-protobuf-3.21.12-x64-mingw-ucrt unable to convert "\xDB" from ASCII-8BIT to UTF-8 for lib/google/protobuf/descriptor_pb.rb, skipping Parsing documentation for sass-embedded-1.57.1-x64-mingw-ucrt Parsing documentation for jekyll-4.3.1 Done installing documentation for ffi, google-protobuf, sass-embedded, jekyll after 2 seconds Successfully installed bundler-2.4.3 Parsing documentation for bundler-2.4.3 Done installing documentation for bundler after 0 seconds 5 gems installed

C:\Users\Liuzf>jekyll -v E:/sitebuild/rubyinstaller/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems.rb:265:in find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException) from E:/sitebuild/rubyinstaller/Ruby31-x64/lib/ruby/site_ruby/3.1.0/rubygems.rb:284:inactivate_bin_path' from C:/Users/Liuzf/AppData/Local/Microsoft/WindowsApps/jekyll:32:in `

'

I think jekyll-4.3.1 had been installed successfully . But why jekyll -v didn't work. Thank you for any help.

My ridk version

C:\Users\Liuzf>ridk version

ruby: path: E:/sitebuild/rubyinstaller/Ruby31-x64 version: 3.1.3 platform: x64-mingw-ucrt ruby_installer: package_version: 3.1.3-1 git_commit: a09714d msys2: path: E:\sitebuild\rubyinstaller\Ruby31-x64\msys64 cc: gcc (Rev6, Built by MSYS2 project) 12.2.0 sh: GNU bash,版本 5.2.9(1)-release (x86_64-pc-msys) os: Microsoft Windows [�汾 10.0.22000.1335]

Largo commented 1 year ago

It looks like that you already had jekyll installed? try

gem uninstall jekyll bundler
gem install jekyll bundler

alternatively, you can try Ruby+Devkit 3.2.0-1 (x64)

also strange: "unable to convert "\xDB" from ASCII-8BIT to UTF-8 for lib/google/protobuf/descriptor_pb.rb, skipping"

JannyCAI commented 1 year ago

It looks like that you already had jekyll installed? try

gem uninstall jekyll bundler
gem install jekyll bundler

alternatively, you can try Ruby+Devkit 3.2.0-1 (x64)

also strange: "unable to convert "\xDB" from ASCII-8BIT to UTF-8 for lib/google/protobuf/descriptor_pb.rb, skipping" Thanks @Largo , I tried 'gem uninstall jekyll bundler' and here is result C:\Users\Liuzf>gem uninstall jekyll bundler Gem 'jekyll' is not installed Gem bundler-2.4.3 cannot be uninstalled because it is a default gem

ccmywish commented 1 year ago

Retry gem install jekyll , try DO NOT use gem install Jekyll bundler

JannyCAI commented 1 year ago

Retry gem install jekyll , try DO NOT use gem install Jekyll bundler

@ccmywish Thanks ,I also tried your advice.Things didn't turn over.

E:\sitebuild\jekyll>gem install jekyll Successfully installed ffi-1.15.5-x64-mingw-ucrt Successfully installed google-protobuf-3.21.12-x64-mingw-ucrt Successfully installed sass-embedded-1.57.1-x64-mingw-ucrt Successfully installed jekyll-4.3.1 Parsing documentation for ffi-1.15.5-x64-mingw-ucrt Parsing documentation for google-protobuf-3.21.12-x64-mingw-ucrt unable to convert "\xDB" from ASCII-8BIT to UTF-8 for lib/google/protobuf/descriptor_pb.rb, skipping Parsing documentation for sass-embedded-1.57.1-x64-mingw-ucrt Parsing documentation for jekyll-4.3.1 Done installing documentation for ffi, google-protobuf, sass-embedded, jekyll after 1 seconds 4 gems installed

E:\sitebuild\jekyll>jekyll -v E:/sitebuild/rubyinstaller/Ruby31-x64/lib/ruby/3.1.0/rubygems.rb:265:in find_spec_for_exe': can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException) from E:/sitebuild/rubyinstaller/Ruby31-x64/lib/ruby/3.1.0/rubygems.rb:284:inactivate_bin_path' from C:/Users/Liuzf/AppData/Local/Microsoft/WindowsApps/jekyll:32:in `

'

ccmywish commented 1 year ago

@JannyCAI

I maintain a Jekyll site on Windows using Ruby 3.1 and Jekyll 4.3, they work with nothing wrong. So, I think it is an issue with your own Ruby environment.

You can:

  1. Reinstall your Ruby by uninstalling and re-downloading and installing RubyInstaller
  2. Or try this https://github.com/ccmywish/rbenv-for-windows to install Ruby
ccmywish commented 1 year ago
image

Note that the parsing error in google-protobuf is not the error that leads to this issue.

If you are Chinese users:

我注意到,你可能是中文用户。你应该是安装过程出错了,或者安装的目录出了什么问题。你可以试着直接默认安装到C盘那个目录,那样使用是绝对没问题的。

JannyCAI commented 1 year ago

I will try to reinstall ruby under default path, thank you for your necessary help @ccmywish

mohits commented 1 year ago

Hi, after you install Jekyll, could you also please:

(1) try to do a gem list and see what it shows. Does it show Jekyll?

(2) on the command line, type PATH to see what the path currently shows.

(3) on command line, do where jekyll or where jekyll.bat or where jekyll.cmd

(4) in the space where you installed ruby, check the /bin folder to see if something with Jekyll in the name is there

Thanks! As someone noted, it's probably tied to the environment, so we might need a bit more information to be sure.

My method for installing Ruby on Windows is here: https://notepad.onghu.com/2022/ruby3.1-windows-day0-install-hello_world/

JannyCAI commented 1 year ago

Thanks mohits @mohits , After install Jekyll , ande gem list command the list didn't show jekyll But when I do where jekyll, it shows the jekyll is in C drive whlie my ruby is in E drive E:\sitebuild\jekyll>where jekyll C:\Users\Liuzf\AppData\Local\Microsoft\WindowsApps\jekyll C:\Users\Liuzf\AppData\Local\Microsoft\WindowsApps\jekyll.bat

Should I reinstall ruby in C drive to be in same path with jekyll?


E:\sitebuild\jekyll>gem install jekyll
Fetching liquid-4.0.4.gem
Successfully installed liquid-4.0.4
Successfully installed ffi-1.15.5-x64-mingw-ucrt
Successfully installed google-protobuf-3.21.12-x64-mingw-ucrt
Successfully installed sass-embedded-1.57.1-x64-mingw-ucrt
Successfully installed jekyll-4.3.1
Parsing documentation for liquid-4.0.4
Installing ri documentation for liquid-4.0.4
Parsing documentation for ffi-1.15.5-x64-mingw-ucrt
Parsing documentation for google-protobuf-3.21.12-x64-mingw-ucrt
unable to convert "\xDB" from ASCII-8BIT to UTF-8 for lib/google/protobuf/descriptor_pb.rb, skipping
Parsing documentation for sass-embedded-1.57.1-x64-mingw-ucrt
Parsing documentation for jekyll-4.3.1
Done installing documentation for liquid, ffi, google-protobuf, sass-embedded, jekyll after 3 seconds
5 gems installed

E:\sitebuild\jekyll>gem list

*** LOCAL GEMS ***

abbrev (default: 0.1.0)
base64 (default: 0.1.1)
benchmark (default: 0.2.0)
bigdecimal (default: 3.1.1)
bundler (default: 2.3.26)
cgi (default: 0.3.5)
csv (default: 3.2.5)
date (default: 3.2.2)
debug (1.6.3)
delegate (default: 0.2.0)
did_you_mean (default: 1.6.1)
digest (default: 3.1.0)
drb (default: 2.1.0)
english (default: 0.7.1)
erb (default: 2.2.3)
error_highlight (default: 0.3.0)
etc (default: 1.3.0)
fcntl (default: 1.0.1)
fiddle (default: 1.1.0)
fileutils (default: 1.6.0)
find (default: 0.1.1)
forwardable (default: 1.3.2)
getoptlong (default: 0.1.1)
io-console (default: 0.5.11)
io-nonblock (default: 0.1.0)
io-wait (default: 0.2.1)
ipaddr (default: 1.2.4)
irb (default: 1.4.1)
json (default: 2.6.1)
logger (default: 1.5.0)
matrix (0.4.2)
minitest (5.15.0)
mutex_m (default: 0.1.1)
net-ftp (0.1.3)
net-http (default: 0.3.0)
net-imap (0.2.3)
net-pop (0.1.1)
net-protocol (default: 0.1.2)
net-smtp (0.3.1)
nkf (default: 0.1.1)
observer (default: 0.1.1)
open-uri (default: 0.2.0)
open3 (default: 0.1.1)
openssl (default: 3.0.1)
optparse (default: 0.2.0)
ostruct (default: 0.5.2)
pathname (default: 0.2.0)
power_assert (2.0.1)
pp (default: 0.3.0)
prettyprint (default: 0.1.1)
prime (0.1.2)
pstore (default: 0.1.1)
psych (default: 4.0.4)
racc (default: 1.6.0)
rake (13.0.6)
rbs (2.7.0)
rdoc (default: 6.4.0)
readline (default: 0.0.3)
reline (default: 0.3.1)
resolv (default: 0.2.1)
resolv-replace (default: 0.1.0)
rexml (3.2.5)
rinda (default: 0.1.1)
rss (0.2.9)
ruby2_keywords (default: 0.0.5)
securerandom (default: 0.2.0)
set (default: 1.0.2)
shellwords (default: 0.1.0)
singleton (default: 0.1.1)
stringio (default: 3.0.1)
strscan (default: 3.0.1)
tempfile (default: 0.1.2)
test-unit (3.5.3)
time (default: 0.2.0)
timeout (default: 0.2.0)
tmpdir (default: 0.1.2)
tsort (default: 0.1.0)
typeprof (0.21.3)
un (default: 0.2.0)
uri (default: 0.11.0)
weakref (default: 0.1.1)
win32ole (default: 1.8.8)
yaml (default: 0.2.0)
zlib (default: 2.1.1)

E:\sitebuild\jekyll>where jekyll
C:\Users\Liuzf\AppData\Local\Microsoft\WindowsApps\jekyll
C:\Users\Liuzf\AppData\Local\Microsoft\WindowsApps\jekyll.bat
mohits commented 1 year ago

hi @JannyCAI - I think this is very useful.

I did the same on my machine and this is what I see:

$ where jekyll
C:\Ruby30-x64\bin\jekyll
C:\Ruby30-x64\bin\jekyll.bat

I have jekyll set up in Ruby 3.0 based on the Ruby versions on my path. It should normally be installed to the \bin directory of your Ruby installation. I expect that this is a bug somewhere (Jekyll or something) which is causing it to be installed incorrectly in your setup.

If you don't mind installing it to the C drive and the default path, I have a feeling it will work better... the installation instructions that I use are in the previous message I sent.

Good luck! Do let us know how it progresses.

larskanis commented 1 year ago

@JannyCAI Thank you for your tenacity to get jekyll running. And sorry for asking so late. But could you post the output of gem env and the output of the set command please? It should give us a better indication of what happens with the gems you install.

Background is: There are three parts that don't fit together for me. First is, that you use Ruby-3.1, but the jekyll executable is installed in C:\Users\Liuzf\AppData\Local\Microsoft\WindowsApps\ which is only done by Ruby-3.2 so far. The other issue is that gem install and gem list seem to use different folders.

mohits commented 1 year ago

Thanks @larskanis - I didn't realise that Ruby 3.2 had changed the location (but at least it explains somewhat that the location isn't purely random), and I wonder what that does for use cases like pik, etc. which switch the path to make it work 🤔