【问题标题】:How to run "bundle exec jekyll new ."如何运行“bundle exec jekyll new”。
【发布时间】:2020-05-11 19:28:33
【问题描述】:

我正在尝试关注“Creating a GitHub Pages site with Jekyll”,但是当我运行以下任何命令时:

$ bundle exec jekyll VERSION new .
$ bundle exec jekyll _4.0.0_ new .
$ bundle exec jekyll 4.0.0 new .

我收到此错误:

"Could not locate Gemfile or .bundle/ directory"

我查看了几个与此错误消息相关的 SO 帖子,但似乎没有一个可以解决我的问题。也许我错过了什么?

一些相关细节:

$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
$ jekyll -v
jekyll 4.0.0
$ type rvm | head -n 1
rvm is a function
$  lsb_release -a
LSB Version:    core-11.0.1ubuntu1-noarch:printing-11.0.1ubuntu1-noarch:security-11.0.1ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:    19.10
Codename:   eoan

【问题讨论】:

    标签: ruby jekyll rvm bundler gemfile


    【解决方案1】:

    GitHub 演练省略了这些命令,但 Bundler 的 bundle init 对此进行了解释:

    这个命令是创建 Gemfile 所必需的:

    $ bundle init
    

    这个用 Jekyll 填充它:

    $ bundle add jekyll
    

    所以当我重新运行我的设置命令时,它可以工作:

    $ bundle exec jekyll 4.0.0 new . --force
    

    GitHub使用的jekyll的具体版本可以在here找到。

    【讨论】:

    • 太棒了,非常感谢!指出bundlejekyll 应该在$PATH 上可能会有所帮助。我没有对/usr/bin//usr/local/bin 的写入权限,所以我做了export GEM_HOME=$HOME/.gem 并将它作为PATH=$GEM_HOME/bin:$PATH 预先添加到我的路径中,这似乎有效。
    • ty @plijnzaad。有用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-01
    相关资源
    最近更新 更多