Site deploy failed: build.command failed

Hello,

After I forked a Jekyll theme (GitHub - alshedivat/al-folio: A beautiful, simple, clean, and responsive Jekyll theme for academics) to get my own repository in git (GitHub - jungyeonwook/al-folio: A beautiful, simple, clean, and responsive Jekyll theme for academics), I have cloned it in the powershell:

PS: C:\Users:\pc\Documents git clone git@github.com:<your-username>/<your-repo-name>.git
cd <your-repo-name>
bundle install
bundle exec jekyll serve

At this point I believe that I have created a local repository at my computer, which is connected to the github repository. To create a static site, I used

bundle exec jekyll build

Then, I tried to deploy it with Netlify as:
Build command: jekyll build
Publish directory: -site/

However, I fail at site deployment, with build.command failed. Here’s the full error code:

1:35:35 AM: Build ready to start
1:35:36 AM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
1:35:36 AM: build-image tag: v3.6.1
1:35:36 AM: buildbot version: 52e88d4737b20536efcd50639fdcd98a91b0d98c
1:35:37 AM: Fetching cached dependencies
1:35:37 AM: Failed to fetch cache, continuing with build
1:35:37 AM: Starting to prepare the repo for build
1:35:37 AM: No cached dependencies found. Cloning fresh repo
1:35:37 AM: git clone https://github.com/jungyeonwook/al-folio
1:35:41 AM: Preparing Git Reference refs/heads/master
1:35:43 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: '_site' versus '_site/' in the Netlify UI
1:35:43 AM: Starting build script
1:35:43 AM: Installing dependencies
1:35:43 AM: Python version set to 2.7
1:35:44 AM: v12.18.0 is already installed.
1:35:45 AM: Now using node v12.18.0 (npm v6.14.4)
1:35:45 AM: Started restoring cached build plugins
1:35:45 AM: Finished restoring cached build plugins
1:35:45 AM: Attempting ruby version 2.7.1, read from environment
1:35:47 AM: Using ruby version 2.7.1
1:35:48 AM: Using PHP version 5.6
1:35:48 AM: Started restoring cached ruby gems
1:35:48 AM: Finished restoring cached ruby gems
1:35:48 AM: Installing gem bundle
1:35:48 AM: [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/opt/build/cache/bundle'`, and stop using this flag
1:35:48 AM: [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all`
1:35:52 AM: Fetching gem metadata from https://rubygems.org/........
1:35:52 AM: Fetching gem metadata from https://rubygems.org/.
1:35:55 AM: Resolving dependencies....................
1:35:55 AM: Using bundler 2.2.5
1:35:55 AM: Fetching concurrent-ruby 1.1.8
1:35:55 AM: Fetching thread_safe 0.3.6
1:35:55 AM: Fetching latex-decode 0.3.2
1:35:55 AM: Fetching namae 1.0.2
1:35:55 AM: Fetching minitest 5.14.4
1:35:55 AM: Fetching zeitwerk 2.4.2
1:35:55 AM: Fetching public_suffix 4.0.6
1:35:55 AM: Fetching coffee-script-source 1.11.1
1:35:55 AM: Installing zeitwerk 2.4.2
1:35:55 AM: Installing coffee-script-source 1.11.1
1:35:55 AM: Installing namae 1.0.2
1:35:55 AM: Installing minitest 5.14.4
1:35:55 AM: Installing thread_safe 0.3.6
1:35:55 AM: Installing latex-decode 0.3.2
1:35:55 AM: Installing public_suffix 4.0.6
1:35:56 AM: Installing concurrent-ruby 1.1.8
1:35:56 AM: Fetching execjs 2.7.0
1:35:56 AM: Fetching colorator 1.1.0
1:35:56 AM: Fetching unf_ext 0.0.7.7
1:35:56 AM: Fetching eventmachine 1.2.7
1:35:56 AM: Fetching ffi 1.14.2
1:35:56 AM: Fetching http_parser.rb 0.6.0
1:35:56 AM: Fetching faraday-net_http 1.0.1
1:35:56 AM: Fetching multipart-post 2.1.1
1:35:56 AM: Installing execjs 2.7.0
1:35:56 AM: Installing colorator 1.1.0
1:35:56 AM: Installing faraday-net_http 1.0.1
1:35:56 AM: Installing multipart-post 2.1.1
1:35:56 AM: Fetching ruby2_keywords 0.0.4
1:35:56 AM: Installing http_parser.rb 0.6.0 with native extensions
1:35:56 AM: Installing eventmachine 1.2.7 with native extensions
1:35:56 AM: Installing unf_ext 0.0.7.7 with native extensions
1:35:56 AM: Fetching forwardable-extended 2.6.0
1:35:56 AM: Fetching gemoji 3.0.1
1:35:56 AM: Fetching rb-fsevent 0.10.4
1:35:56 AM: Installing ruby2_keywords 0.0.4
1:35:56 AM: Installing rb-fsevent 0.10.4
1:35:56 AM: Installing forwardable-extended 2.6.0
1:35:56 AM: Installing ffi 1.14.2 with native extensions
1:35:57 AM: Fetching rexml 3.2.4
1:35:57 AM: Installing gemoji 3.0.1
1:35:57 AM: Fetching liquid 4.0.3
1:35:57 AM: Installing rexml 3.2.4
1:35:57 AM: Installing liquid 4.0.3
1:36:18 AM: Fetching rouge 3.26.0
1:36:18 AM: Fetching mercenary 0.3.6
1:36:18 AM: Installing mercenary 0.3.6
1:36:18 AM: Installing rouge 3.26.0
1:36:28 AM: Fetching rubyzip 2.3.0
1:36:28 AM: Fetching safe_yaml 1.0.5
1:36:28 AM: Installing rubyzip 2.3.0
1:36:28 AM: Installing safe_yaml 1.0.5
1:36:29 AM: Fetching jekyll-paginate 1.1.0
1:36:29 AM: Fetching jekyll-swiss 1.0.0
1:36:29 AM: Fetching racc 1.5.2
1:36:29 AM: Fetching jekyll-email-protect 1.1.0
1:36:29 AM: Fetching unicode-display_width 1.7.0
1:36:29 AM: Fetching jekyll-twitter-plugin 2.1.0
1:36:29 AM: Fetching unicode_utils 1.4.0
1:36:29 AM: Fetching tzinfo 1.2.9
1:36:29 AM: Installing jekyll-paginate 1.1.0
1:36:29 AM: Installing unicode-display_width 1.7.0
1:36:29 AM: Installing jekyll-email-protect 1.1.0
1:36:29 AM: Installing jekyll-swiss 1.0.0
1:36:29 AM: Installing tzinfo 1.2.9
1:36:29 AM: Installing unicode_utils 1.4.0
1:36:29 AM: Fetching bibtex-ruby 4.4.7
1:36:29 AM: Fetching citeproc 1.0.10
1:36:29 AM: Fetching csl 1.5.2
1:36:29 AM: Installing jekyll-twitter-plugin 2.1.0
1:36:29 AM: Fetching i18n 0.9.5
1:36:29 AM: Installing racc 1.5.2 with native extensions
1:36:29 AM: Installing citeproc 1.0.10
1:36:29 AM: Installing i18n 0.9.5
1:36:29 AM: Installing csl 1.5.2
1:36:29 AM: Installing bibtex-ruby 4.4.7
1:36:30 AM: Fetching addressable 2.7.0
1:36:30 AM: Fetching coffee-script 2.4.1
1:36:30 AM: Fetching faraday 1.3.0
1:36:30 AM: Installing addressable 2.7.0
1:36:30 AM: Fetching pathutil 0.16.2
1:36:30 AM: Fetching kramdown 2.3.0
1:36:30 AM: Installing coffee-script 2.4.1
1:36:30 AM: Installing faraday 1.3.0
1:36:30 AM: Fetching unf 0.1.4
1:36:30 AM: Installing pathutil 0.16.2
1:36:30 AM: Installing kramdown 2.3.0
1:36:30 AM: Fetching ethon 0.12.0
1:36:30 AM: Fetching rb-inotify 0.10.1
1:36:30 AM: Installing ethon 0.12.0
1:36:31 AM: Fetching em-websocket 0.5.2
1:36:31 AM: Installing unf 0.1.4
1:36:31 AM: Fetching terminal-table 1.8.0
1:36:31 AM: Installing rb-inotify 0.10.1
1:36:31 AM: Installing em-websocket 0.5.2
1:36:31 AM: Installing terminal-table 1.8.0
1:36:32 AM: Fetching citeproc-ruby 1.1.13
1:36:32 AM: Fetching csl-styles 1.0.1.10
1:36:32 AM: Fetching activesupport 6.0.3.5
1:36:32 AM: Fetching jekyll-coffeescript 1.1.1
1:36:32 AM: Fetching ruby-enum 0.9.0
1:36:32 AM: Fetching simpleidn 0.2.1
1:36:32 AM: Fetching sawyer 0.8.2
1:36:32 AM: Fetching typhoeus 1.4.0
1:36:32 AM: Installing jekyll-coffeescript 1.1.1
1:36:32 AM: Installing sawyer 0.8.2
1:36:32 AM: Installing citeproc-ruby 1.1.13
1:36:32 AM: Fetching sass-listen 4.0.0
1:36:32 AM: Installing ruby-enum 0.9.0
1:36:32 AM: Installing typhoeus 1.4.0
1:36:32 AM: Installing simpleidn 0.2.1
1:36:32 AM: Fetching listen 3.4.1
1:36:32 AM: Installing activesupport 6.0.3.5
1:36:32 AM: Installing sass-listen 4.0.0
1:36:32 AM: Installing listen 3.4.1
1:36:32 AM: Fetching kramdown-parser-gfm 1.1.0
1:36:32 AM: Fetching nokogiri 1.11.1 (x86_64-linux)
1:36:32 AM: Fetching octokit 4.20.0
1:36:33 AM: Installing kramdown-parser-gfm 1.1.0
1:36:33 AM: Fetching commonmarker 0.17.13
1:36:33 AM: Installing octokit 4.20.0
1:36:33 AM: Fetching dnsruby 1.61.5
1:36:33 AM: Fetching sass 3.7.4
1:36:33 AM: Installing commonmarker 0.17.13 with native extensions
1:36:33 AM: Installing dnsruby 1.61.5
1:36:33 AM: Fetching jekyll-watch 2.2.1
1:36:33 AM: Installing sass 3.7.4
1:36:33 AM: Installing csl-styles 1.0.1.10
1:36:33 AM: Installing jekyll-watch 2.2.1
1:36:33 AM: Fetching jekyll-gist 1.5.0
1:36:34 AM: Installing jekyll-gist 1.5.0
1:36:34 AM: Installing nokogiri 1.11.1 (x86_64-linux)
1:36:44 AM: Fetching github-pages-health-check 1.17.0
1:36:44 AM: Fetching html-pipeline 2.14.0
1:36:45 AM: Fetching jekyll-sass-converter 1.5.2
1:36:45 AM: Installing jekyll-sass-converter 1.5.2
1:36:45 AM: Installing html-pipeline 2.14.0
1:36:45 AM: Installing github-pages-health-check 1.17.0
1:36:45 AM: Fetching jekyll 3.9.0
1:36:45 AM: Installing jekyll 3.9.0
1:36:45 AM: Fetching jekyll-github-metadata 2.13.0
1:36:45 AM: Fetching jekyll-avatar 0.7.0
1:36:45 AM: Fetching jekyll-commonmark 1.3.1
1:36:45 AM: Fetching jekyll-feed 0.15.1
1:36:45 AM: Fetching jekyll-default-layout 0.1.4
1:36:45 AM: Fetching jekyll-optional-front-matter 0.3.2
1:36:45 AM: Fetching jekyll-readme-index 0.3.0
1:36:45 AM: Fetching jekyll-mentions 1.6.0
1:36:45 AM: Installing jekyll-github-metadata 2.13.0
1:36:45 AM: Installing jekyll-default-layout 0.1.4
1:36:45 AM: Installing jekyll-mentions 1.6.0
1:36:45 AM: Installing jekyll-feed 0.15.1
1:36:45 AM: Installing jekyll-readme-index 0.3.0
1:36:45 AM: Installing jekyll-optional-front-matter 0.3.2
1:36:45 AM: Installing jekyll-commonmark 1.3.1
1:36:45 AM: Installing jekyll-avatar 0.7.0
1:36:45 AM: Fetching jekyll-redirect-from 0.16.0
1:36:45 AM: Fetching jekyll-relative-links 0.6.1
1:36:45 AM: Fetching jekyll-remote-theme 0.4.2
1:36:45 AM: Fetching jekyll-seo-tag 2.7.1
1:36:45 AM: Installing jekyll-redirect-from 0.16.0
1:36:45 AM: Fetching jekyll-sitemap 1.4.0
1:36:45 AM: Fetching jekyll-titles-from-headings 0.5.3
1:36:45 AM: Installing jekyll-remote-theme 0.4.2
1:36:45 AM: Fetching jemoji 0.12.0
1:36:45 AM: Installing jekyll-relative-links 0.6.1
1:36:45 AM: Installing jekyll-seo-tag 2.7.1
1:36:45 AM: Fetching jekyll-paginate-v2 3.0.0
1:36:45 AM: Installing jemoji 0.12.0
1:36:45 AM: Installing jekyll-titles-from-headings 0.5.3
1:36:45 AM: Installing jekyll-sitemap 1.4.0
1:36:45 AM: Fetching jekyll-scholar 5.16.0
1:36:45 AM: Fetching jekyll-commonmark-ghpages 0.1.6
1:36:45 AM: Installing jekyll-paginate-v2 3.0.0
1:36:46 AM: Installing jekyll-scholar 5.16.0
1:36:46 AM: Installing jekyll-commonmark-ghpages 0.1.6
1:36:46 AM: Fetching jekyll-theme-architect 0.1.1
1:36:46 AM: Fetching jekyll-theme-dinky 0.1.1
1:36:46 AM: Fetching jekyll-theme-cayman 0.1.1
1:36:46 AM: Fetching jekyll-theme-hacker 0.1.2
1:36:46 AM: Installing jekyll-theme-cayman 0.1.1
1:36:46 AM: Installing jekyll-theme-architect 0.1.1
1:36:46 AM: Fetching jekyll-theme-leap-day 0.1.1
1:36:46 AM: Installing jekyll-theme-dinky 0.1.1
1:36:46 AM: Installing jekyll-theme-hacker 0.1.2
1:36:46 AM: Fetching jekyll-theme-merlot 0.1.1
1:36:46 AM: Fetching jekyll-theme-midnight 0.1.1
1:36:46 AM: Fetching jekyll-theme-minimal 0.1.1
1:36:46 AM: Fetching jekyll-theme-modernist 0.1.1
1:36:46 AM: Fetching jekyll-theme-primer 0.5.4
1:36:46 AM: Fetching jekyll-theme-slate 0.1.1
1:36:46 AM: Fetching jekyll-theme-tactile 0.1.1
1:36:46 AM: Installing jekyll-theme-modernist 0.1.1
1:36:46 AM: Installing jekyll-theme-leap-day 0.1.1
1:36:46 AM: Installing jekyll-theme-minimal 0.1.1
1:36:46 AM: Installing jekyll-theme-slate 0.1.1
1:36:46 AM: Installing jekyll-theme-primer 0.5.4
1:36:46 AM: Installing jekyll-theme-tactile 0.1.1
1:36:46 AM: Installing jekyll-theme-merlot 0.1.1
1:36:46 AM: Installing jekyll-theme-midnight 0.1.1
1:36:46 AM: Fetching jekyll-theme-time-machine 0.1.1
1:36:46 AM: Fetching minima 2.5.1
1:36:46 AM: Installing jekyll-theme-time-machine 0.1.1
1:36:46 AM: Installing minima 2.5.1
1:36:47 AM: Fetching github-pages 212
1:36:47 AM: Installing github-pages 212
1:36:47 AM: Bundle complete! 9 Gemfile dependencies, 104 gems now installed.
1:36:47 AM: Bundled gems are installed into `/opt/build/cache/bundle`
1:36:47 AM: Post-install message from dnsruby:
1:36:47 AM: Installing dnsruby...
1:36:47 AM:   For issues and source code: https://github.com/alexdalitz/dnsruby
1:36:47 AM:   For general discussion (please tell us how you use dnsruby): https://groups.google.com/forum/#!forum/dnsruby
1:36:47 AM: Post-install message from sass:
1:36:47 AM: Ruby Sass has reached end-of-life and should no longer be used.
1:36:47 AM: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
1:36:47 AM:   primary implementation: https://sass-lang.com/install
1:36:47 AM: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
1:36:47 AM:   sassc gem: https://github.com/sass/sassc-ruby#readme
1:36:47 AM: * For more details, please refer to the Sass blog:
1:36:47 AM:   https://sass-lang.com/blog/posts/7828841
1:36:47 AM: Post-install message from html-pipeline:
1:36:47 AM: -------------------------------------------------
1:36:47 AM: Thank you for installing html-pipeline!
1:36:47 AM: You must bundle Filter gem dependencies.
1:36:47 AM: See html-pipeline README.md for more details.
1:36:47 AM: https://github.com/jch/html-pipeline#dependencies
1:36:47 AM: -------------------------------------------------
1:36:47 AM: Gem bundle installed
1:36:47 AM: Started restoring cached go cache
1:36:47 AM: Finished restoring cached go cache
1:36:47 AM: go version go1.14.4 linux/amd64
1:36:47 AM: go version go1.14.4 linux/amd64
1:36:47 AM: Installing missing commands
1:36:47 AM: Verify run directory
1:36:49 AM: ​
1:36:49 AM: ────────────────────────────────────────────────────────────────
1:36:49 AM:   Netlify Build                                                 
1:36:49 AM: ────────────────────────────────────────────────────────────────
1:36:49 AM: ​
1:36:49 AM: ❯ Version
1:36:49 AM:   @netlify/build 9.3.0
1:36:49 AM: ​
1:36:49 AM: ❯ Flags
1:36:49 AM:   deployId: 6037d1d73216ea135e5a814a
1:36:49 AM:   mode: buildbot
1:36:49 AM: ​
1:36:49 AM: ❯ Current directory
1:36:49 AM:   /opt/build/repo
1:36:49 AM: ​
1:36:49 AM: ❯ Config file
1:36:49 AM:   No config file was defined: using default values.
1:36:49 AM: ​
1:36:49 AM: ❯ Context
1:36:49 AM:   production
1:36:49 AM: ​
1:36:49 AM: ────────────────────────────────────────────────────────────────
1:36:49 AM:   1. Build command from Netlify app                             
1:36:49 AM: ────────────────────────────────────────────────────────────────
1:36:49 AM: ​
1:36:49 AM: $ jekyll build
1:36:51 AM: Configuration file: /opt/build/repo/_config.yml
1:36:52 AM:             Source: /opt/build/repo
1:36:52 AM:        Destination: /opt/build/repo/_site
1:36:52 AM:  Incremental build: disabled. Enable with --incremental
1:36:52 AM:       Generating...
1:36:52 AM:          AutoPages: Disabled/Not configured in site.config.
1:36:52 AM:         Pagination: Complete, processed 1 pagination page(s)
1:36:52 AM:   Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository. in /opt/build/repo/_posts/2020-09-28-github-metadata.md
1:36:52 AM:              ERROR: YOUR SITE COULD NOT BE BUILT:
1:36:52 AM:                     ------------------------------------
1:36:52 AM:                     No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.
1:36:52 AM: ​
1:36:52 AM: ────────────────────────────────────────────────────────────────
1:36:52 AM:   "build.command" failed                                        
1:36:52 AM: ────────────────────────────────────────────────────────────────
1:36:52 AM: ​
1:36:52 AM:   Error message
1:36:52 AM:   Command failed with exit code 1: jekyll build
1:36:52 AM: ​
1:36:52 AM:   Error location
1:36:52 AM:   In Build command from Netlify app:
1:36:52 AM:   jekyll build
1:36:52 AM: ​
1:36:52 AM:   Resolved config
1:36:52 AM:   build:
1:36:52 AM:     command: jekyll build
1:36:52 AM:     commandOrigin: ui
1:36:52 AM:     publish: /opt/build/repo/_site
1:36:52 AM: Caching artifacts
1:36:52 AM: Started saving ruby gems
1:36:52 AM: Finished saving ruby gems
1:36:52 AM: Started saving build plugins
1:36:52 AM: Finished saving build plugins
1:36:52 AM: Started saving pip cache
1:36:52 AM: Finished saving pip cache
1:36:52 AM: Started saving emacs cask dependencies
1:36:52 AM: Finished saving emacs cask dependencies
1:36:52 AM: Started saving maven dependencies
1:36:53 AM: Finished saving maven dependencies
1:36:53 AM: Started saving boot dependencies
1:36:53 AM: Finished saving boot dependencies
1:36:53 AM: Started saving rust rustup cache
1:36:53 AM: Finished saving rust rustup cache
1:36:53 AM: Started saving go dependencies
1:36:53 AM: Finished saving go dependencies
1:36:55 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:36:55 AM: Failing build: Failed to build site
1:36:55 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
1:36:55 AM: Finished processing build request in 1m18.870653074s

Have you setup the required variable?

Hi hrishikesh,

My outcome is:

PS C:\Users\pc\Documents\al-folio> git remote add origin https://github.com/jungyeonwook/al-folio
error: remote origin already exists.

PS C:\Users\pc\Documents\al-folio> git remote -v
origin  https://github.com/jungyeonwook/al-folio.git (fetch)
origin  https://github.com/jungyeonwook/al-folio.git (push)

Does this mean I have repo name, but somehow netlify cannot identify them?

You’ve your repo connected locally, Netlify can’t access that! You’d have to set the repo using other methods.

Hi hrishikesh, after talking to you, I solved it by setting the correct repository in the _config.yml by adding

repository: jungyeonwook/al-polio

Deployment success! Okay, but now I see a different issue. The deployed site is different from what I preview on my local server. Can you help me with this? ( https://elated-carson-508e9b.netlify.app)

Roughly, they seem like

where it should originally look like

https://alshedivat.github.io/al-folio/

Why? I don’t see an error message.

Did you check the console?

Hi hrishikesh,

Checking the console (using ctr+Shift+J), the errors were identified and they were fixed by resetting the url and baseurl in the _config.yml correctly to basically empty.

url:
baseurl:

Thank you so much. This helped me to the extent that I could have almost never reached by myself!

All the best.