Jekyll - Command Not Found

Jekyll - command not found

The easiest method of doing this is to use RVM. It manages Ruby and all its gems for you and it's easy to use. See this link for using it.

If you did not want to use that you will need to modify your PATH variables so it can find your gems. I have found this to be tedious and reverted to RVM, but here are the general steps.

You will need to find out where your gems are getting installed. If you did gem install ... the gems will be in ~/.gem/ruby/1.8/gems/bin, if you used sudo gem install ... the gems will be somewhere in /System/Library/Frameworks/Ruby.framework/Versions/1.8/Resources

You have to add this path to your PATH variable. Easiest way to do this is by running :
echo 'PATH=$PATH:above/path/to/gems' >> ~/.bash_profile

jekyll installed but 'command not found'

Okay I had to check what exatly does the $PATH means, and for what it is.

The problem was simple, somehow my ruby installion directory wasnt in my $path variable.

Useful links: Mac OS X: Set / Change $PATH Variable

Okay so here is the thing how I solved it:

echo "$PATH"
gem uninstall jekyll
find / -name jekyll (to delete if there is any leftovers somewhere )
gem environment ( get EXECUTABLE DIRECTORY path )
nano $HOME/.bash_profile ( go to the end of document and insert a new line )
export PATH="/usr/local/Cellar/ruby/2.0.0-p247/bin:$PATH"

you can do this on a templorary way by just writing it in terminal and not saving it in your .bash_profile

After installing jekyll, getting -bash: jekyll command not found

I know that when I installed rvm, (or maybe it was during the homebrew install), I received a notice that I have both .profile and .bash_profile and it asked me to add source ~/.profile to .bash_profile could that be the problem?

Yes. Do what it said there and you should have access to the jekyll command.

user$ echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

Why is my jekyll command not working anymore?

I found a solution, that I think is very not clean, but works for now.

I have two directories in /Library/Ruby/Gems/:

  • 2.0.0/
    • gems/
    • specifications/
    • ...
  • 2.3.0/
    • gems/
    • specifications/
    • ...

The error output, when I try to run jekyll, tells that it checks (among others) in /Library/Ruby/Gems/2.3.0, but as I said in my question, there aren't any jekyll-related file in there.

So, I manually copied all the files from /Library/Ruby/Gems/2.0.0/gems and /Library/Ruby/Gems/2.0.0/specifications and pasted them in /Library/Ruby/Gems/2.3.0/gems and /Library/Ruby/Gems/2.3.0/specifications respectively.

I guess that the files I've copied are maybe outdated for the Ruby version I have (?), but it works perfectly.

Maybe there is a more conventional way to make it work?

jekyll error / sh: command not found: jekyll

So after @tamouse suggested to run brew doctor I got theses warnings and I managed to fix them and I think this was the main issue after upgrading to OSX 10.9.

After that I installed Ruby using

rvm install ruby-2.0.0-p247

and this fixed the issue.

Thanks every one

Gem does not install Jekyll on Ubuntu 14.04: command not recognized

We have two apparently contradictory pieces of information. On one hand jekyll is installed since the command jekyll -v is recognized. On the other hand, both the error you get and the gem list output tell us that your particular version of Ruby doesn't have jekyll installed.

You have a couple of issues to contend with:

  1. OS vs Gem
  2. Ruby version

Here is how you can try to solve it:

  1. Uninstall the apt-get version of jekyll.
  2. Run jekyll -v to verify that you get a command not found error. If it's still a recognized command, run a which jekyll and sudo find / -name jekyll to figure out what's being executed.
  3. With jekyll gone for good, run ruby -v and take note of the version you are using.
  4. Install jekyll with gem install jekyll (add sudo if necessary).
  5. If you've closed your shell or switched to a different directory, run ruby -v again to make sure you are using the same version as before.
  6. Run gem list and this time it should be there.
  7. Run jekyll -v again and it should work.

jekyll installed but the terminal diplays : command not found

ok , well I don't what was exactly the reason , but I had to uninstall ruby and reinstall it from scratch as well as python .. I just followed this tutorial and it could help me

https://www.youtube.com/watch?v=EtqZVTIro_c



Related Topics



Leave a reply



Submit