ruby - 如何运行 "bundle exec jekyll new ."

标签 ruby jekyll rvm bundler gemfile

我正在尝试遵循“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

最佳答案

GitHub 演练忽略了这些命令,但 Bundler 的 bundle init 解释它:
这个命令是创建 Gemfile 所必需的:

$ bundle init
用 Jekyll 填充它:
$ bundle add jekyll
所以当我重新运行我的设置命令时,它起作用了:
$ bundle exec jekyll 4.0.0 new . --force
jekyll的具体版本可以找到 GitHub 使用的 here .

关于ruby - 如何运行 "bundle exec jekyll new .",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59913903/

相关文章:

docker - 如何从Docker内部访问源代码?

ruby-on-rails - 为什么一个应用程序在系统环境下可以正常运行,但在 RVM 下却不行?

ruby - 为什么 bundler 看不到自定义的 gem 源?

ruby-on-rails - 保持 Mechanize 页面超过请求边界

ruby-on-rails - 在 ruby​​ on rails 中更新数据库字段

Jekyll 每次都会重新编译每一页

Jekyll 图像无法加载 : 403 error

ruby-on-rails - 如何从 Rails 4 中的字符串中删除文件扩展名?

ruby - 使用 rails 和 mongodb 重新索引 solr 时出错

ruby-on-rails-3.1 - Rails 不适用于 Lion