gpt4 book ai didi

ruby - 命令未找到 Jekyll

转载 作者:太空宇宙 更新时间:2023-11-03 16:02:50 25 4
gpt4 key购买 nike

我正在尝试使用 this template 创建和发布 Jekyll 博客.

我最初安装了 Jekyll。运气不好,我确实求助于通过 sudo 安装它。 (现在已经卸载了它!)

Jekyll(1.4.2, 1.0.3) 并且正在使用 ruby​​ 2.0.0p195 运行 rvm。安装 gem 后,我在文件夹中运行 jekyll serve 但出现错误:Zsh Command Not Found。我尝试改变我的路径无济于事。有关如何排除故障的任何建议?

由于与工作项目相关的依赖关系,我无法卸载/重新安装 nokogiri(请参阅其他 SO 文章)。

最佳答案

如果您使用的是 rvm,则不应使用 sudo 安装 gems。 Rvm 是特定于用户的(二进制文件都在您的主目录中),因此使用 sudo 将 Ruby 的东西放在系统范围的文件夹中是行不通的。只需在没有 sudo 的情况下安装,你应该没问题。

rvm 文档试图在这里稍微解释一下:
http://rvm.io/rubies/rubygems

DO NOT use sudo...

...to work with RVM gems. When you do sudo you are running commands as root, another user in another shell and hence all of the setup that RVM has done for you is ignored while the command runs under sudo (such things as GEM_HOME, etc...). So to reiterate, as soon as you 'sudo' you are running as the root system user which will clear out your environment as well as any files it creates are not able to be modified by your user and will result in strange things happening. (You will start to think that someone has a voodoo doll of your application...)

关于ruby - 命令未找到 Jekyll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20902132/

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