【发布时间】:2019-07-10 15:54:31
【问题描述】:
我正在使用 Cloud9 和 GitHub(私人存储库)。我已经能够将基本登录页面部署到 Netlify,但是当我尝试部署 任何 Jekyll 站点时,我不断收到相同的错误消息。部署日志的片段:
> Installing gem bundle
> You must use Bundler 2 or greater with this lockfile.
> Error during gem install
> failed during stage 'building site': Build script returned non-zero exit code: 1
> Error running command: Build script returned non-zero exit code: 1
> Failing build: Failed to build site
经过多次失败的尝试,我创建了一个新的测试开发环境。根据 Jekyll 文档,我确保我拥有最新的 Ruby、RubyGems、gcc、g++、make 和依赖项。做了通常的配置,然后 Jekyll 新的 test_directory。步骤:
> gem install jekyll bundler
> gem install bundle
> gem update --system
> cd new_directory && bundle install
> ~/new_directory/ bundle update
> ~/new_directory/ bundle exec jekyll serve
*** Works perfectly on localhost ***
此时一切看起来都很好(jekyll 3.8.5 - gem 3.0.2 - ruby 2.5.1p57(2018-03-29 修订版 63029)[x86_64-linux])
重要提示:
> bundler -v
returns
> Bundler version 2.0.1
在我推送到全新的 repo 后,我收到与上面相同的错误消息:
“将 Bundler 2 或更高版本用于此锁定文件”
来自锁文件的片段:
> DEPENDENCIES
> -jekyll (~> 3.8.5)
> -jekyll-feed (~> 0.6)
> -minima (~> 2.0)
> -tzinfo-data
> RUBY VERSION
> ruby 2.5.1p57
> BUNDLED WITH
> 2.0.1
我也将此添加到 _config.yml 文件中:
> url: "https://infallible-hodgkin-e15692.netlify.com/"
根据 Netlify 文档,我在根目录中添加了一个 /.ruby-version 文件,其中包含以下行:
> ruby 2.5.1
更新所有内容并使用 git push 后,它仍然无法构建我的网站,但这次我在部署日志上看到了几行新行:
>** WARNING **
> Using custom ruby version ruby 2.5.1, this will slow down the build.
> To ensure fast builds, set the RUBY_VERSION environment variable, or .ruby-version file, to an included ruby version.
> Included versions: 2.3.6 2.4.3 2.2.9
不用说,我尝试切换到每个“包含”的 Ruby -v(rvm 使用 ..*)。经历了安装每个版本的过程,并且每次都重复上述步骤。没有运气。
非常感谢任何有关下一步尝试的建议。抱歉,这篇文章很长,我尽量简洁。如果我遗漏了什么,请告诉我。
【问题讨论】:
标签: github rubygems jekyll bundler netlify