Jekyll - command not found

后端 未结 15 1821

I am trying to get Jekyll running but I have no experience with Ruby.
As far as I can tell the installation of Jekyll has succeeded.
However:

$ jekyll


        
相关标签:
15条回答
  • 2021-01-31 02:29

    Easier than creating a symlink just install it correctly. If you got permission errors like a lot of people are getting when trying to use

    gem install jekyll
    

    instead use

    sudo gem install jekyll
    
    0 讨论(0)
  • 2021-01-31 02:35

    When you use the --user-install option, RubyGems will install the gems to a directory inside your home directory, something like ~/.gem/ruby/1.9.1. The commands provided by the gems you installed will end up in ~/.gem/ruby/1.9.1/bin. For the programs installed there to be available for you, you need to add ~/.gem/ruby/1.9.1/bin to your PATH environment variable.

    For example, if you use bash you can add that directory to your PATH by adding code like this to your ~/.bashrc file:

    if which ruby >/dev/null && which gem >/dev/null; then
        PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
    fi
    

    https://guides.rubygems.org/faqs/#user-install

    I put it in the .bash_profile (Mac OS X).

    https://hathaway.cc/2008/06/how-to-edit-your-path-environment-variables-on-mac/

    0 讨论(0)
  • 2021-01-31 02:36

    If you are using MacOS, from the Troubleshooting guide:

    Jekyll & Mac OS X 10.11Permalink

    With the introduction of System Integrity Protection, several directories that were previously writable are now considered system locations and are no longer available. Given these changes, there are a couple of simple ways to get up and running. One option is to change the location where the gem will be installed (again, using sudo only if necessary):

    $ gem install -n /usr/local/bin jekyll
    
    0 讨论(0)
  • 2021-01-31 02:37

    One solution would be editing your ~/.bashrc file and add this line:

    PATH=$PATH:~/.gem/ruby/1.8/gems/bin

    This will add ~/.gem/ruby/1.8/gems/bin in Bash's lookup path.

    Reopen the terminal and it should work. Or you can use the following command:

    . ~/.bashrc

    0 讨论(0)
  • 2021-01-31 02:42

    @jayunit100,

    I'm running into the same issue with a Jekyll blog. I've installed the gem via RVM in a 'Blog directory and the _config.yml file says that it should generate into Blog/_site. Is it as simple as adding Blog to the PATH or is there something else I'm missing?

    Update: My bad, I didn't really have the gem installed. Lesson learned: rvm requirements and brew doctor are there for a reason - before you install stuff USE THEM

    0 讨论(0)
  • 2021-01-31 02:43

    If you are using RBENV instead of RVM you simply need to run rehash in the command line after installing jekyll:

    rbenv rehash
    
    0 讨论(0)
提交回复
热议问题