简体   繁体   中英

/usr/bin/jekyll: No such file or directory

I am having troubles with jekyll. I have Ubuntu 14.04. I've tried to deploy a static site with rack-jekyll and I ended up messing up with my ruby and jekyll installation files.

I've already made ruby work just fine (I used rbenv to install version 2.2.3) but I still have problems with jekyll. When I type jekyll new smth or jekyll serve it shows:

bash: /usr/bin/jekyll: No such file or directory

I have already installed jekyll but it still shows that. From what I searched it might be a problem with some path.

Here are some information that might help to find a solution:

rafael@rafael-K56CM:~$ which jekyll
/home/rafael/.rbenv/shims/jekyll
rafael@rafael-K56CM:~$ sudo find / -name jekyll
[sudo] password for rafael: 
/home/rafael/.rbenv/shims/jekyll
/home/rafael/.rbenv/versions/2.2.3/bin/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/bin/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-2.5.3/lib/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-coffeescript-1.0.1/lib/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-sass-converter-1.3.0/lib/jekyll
/home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-watch-1.2.1/lib/jekyll
rafael@rafael-K56CM:~$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.8
  - RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: /home/rafael/.rbenv/versions/2.2.3/bin/ruby
  - EXECUTABLE DIRECTORY: /home/rafael/.rbenv/versions/2.2.3/bin
  - SPEC CACHE DIRECTORY: /home/rafael/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/rafael/.rbenv/versions/2.2.3/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/rafael/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0
     - /home/rafael/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["https://rubygems.org/", "http://rubygems.org/"]
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
     - http://rubygems.org/
  - SHELL PATH:
     - /home/rafael/.rbenv/versions/2.2.3/bin
     - /usr/lib/rbenv/libexec
     - /home/rafael/.rbenv/shims
     - /home/rafael/.rbenv/bin
     - /home/rafael/.rbenv/shims
     - /home/rafael/.rbenv/bin
     - /usr/local/heroku/bin
     - /home/rafael/.rbenv/plugins/ruby-build/bin
     - /home/rafael/.rbenv/shims
     - /home/rafael/.rbenv/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /home/rafael/.rvm/bin
     - /home/rafael/.rvm/bin

This issue can be solved by creating a symbolic link to the jekyll executable:

sudo ln -s /path/to/project/gems/bin/jekyll /usr/bin/jekyll

Use the which command to identify where the jekyll executable is installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM