/ usr / bin / jekyll:没有这样的文件或目录

时间:2015-09-03 20:59:39

标签: ruby linux gem jekyll

我和杰基尔有麻烦。我有Ubuntu 14.04。我尝试使用rack-jekyll部署一个静态站点,最后我搞砸了我的ruby和jekyll安装文件。

我已经让ruby工作得很好(我使用rbenv来安装2.2.3版本)但是我仍然遇到了jekyll的问题。当我输入jekyll new smthjekyll serve时,会显示:

  

bash:/ usr / bin / jekyll:没有这样的文件或目录

我已经安装了jekyll,但它仍然显示了这一点。从我搜索的内容来看,这可能是一个问题。

以下是一些可能有助于找到解决方案的信息:

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

1 个答案:

答案 0 :(得分:2)

可以通过创建jekyll可执行文件的符号链接来解决此问题:

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

使用which命令确定jekyll可执行文件的安装位置。