Search code examples
rubyrubygemsjekyllgithub-pages

Ruby gem jekyll is installed but is not recognized


As a premise, i know basically nothing about how ruby and ruby gems work. I just wanted to make a static website on github pages by following this tutorial: giraffe academy

I'm on Windows 10, ruby 3.2.2 gem 3.4.10.

After (what i think it is) a successful installation of jekyll, it doesn't seem that windows can find the path to it to use it as a command.

I installed jekyll with

`gem install bundler jekyll`

And got a positive response, as a matter of fact i checked by

`gem which jekyll`

and the result is the path to it C:/Users/.../.local/share/gem/ruby/3.2.0/gems/jekyll-4.3.2/lib/jekyll.rb

and with gem list

which returned between the others

irb (default: 1.6.2)
jekyll (4.3.2)
jekyll-sass-converter (3.0.0)
jekyll-watch (2.2.1)
json (default: 2.6.3)
kramdown (2.4.0)

still when i try to use jekyll as a command i get the following error:

    jekyll new githubTestWebsite

   'jekyll' is not recognized as an internal or external command,
    operable program or batch file.

i tried multiple times to reinstall it and to browse multiple forums but nothing seems to work. A thing i noticed is that the jekyll gem is installed under C: while my actual Ruby is installed under G: (which is my other drive) can it be relevant? anyways calling it from either one doesn't work.


Solution

  • I found the solution. I was installing jekyll correctly with:

    `gem install bundler jekyll`
    

    but from the wrong command prompt. I was using the standard one (red), instead what i should have done is using the 'start command prompt with ruby' (green) option.

    At first i didn't notice it was there since i didn't restart the pc, so there was no option to choose.

    enter image description here