gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 09:02:21 25 4
gpt4 key购买 nike

我在使用 jekyll 时遇到了麻烦。我有 Ubuntu 14.04。我曾尝试使用 rack-jekyll 部署一个静态站点,但最终弄乱了我的 ruby​​ 和 jekyll 安装文件。

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

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

我已经安装了 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

最佳答案

这个问题可以通过创建指向 jekyll 可执行文件的符号链接(symbolic link)来解决:

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

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

关于ruby -/usr/bin/jekyll : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32385318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com