# Failed during stage 'building site'

**URL:** <https://answers.netlify.com/t/failed-during-stage-building-site/1488>\
**Category:** Support\
**Tags:** building\
**Created:** [June 17, 2019, 5:46pm UTC](https://answers.netlify.com/t/failed-during-stage-building-site/1488 "2019-06-17T17:46:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![happyrabbit](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/happyrabbit/32/1272_2.png) [@happyrabbit](https://answers.netlify.com/u/happyrabbit)\
**Post date:** [June 17, 2019, 5:46pm UTC](https://answers.netlify.com/t/failed-during-stage-building-site/1488/1 "2019-06-17T17:46:49Z")

</div>

**Briefly summarize the issues you have been experiencing.**

It has been ok until yesterday. Here is the logs:

```auto
10:37:00 AM: Build ready to start
10:37:03 AM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
10:37:03 AM: build-image tag: v2.8.2
10:37:03 AM: buildbot version: 1c5d5da2a8a19e94f07a53f82f5c9b010bad1249
10:37:04 AM: Fetching cached dependencies
10:37:04 AM: Starting to download cache of 456.8MB
10:37:08 AM: Finished downloading cache in 4.393499442s
10:37:08 AM: Starting to extract cache
10:37:16 AM: Finished extracting cache in 8.207125038s
10:37:16 AM: Finished fetching cache in 12.733436067s
10:37:16 AM: Starting to prepare the repo for build
10:37:17 AM: Preparing Git Reference refs/heads/gh-pages
10:37:19 AM: Starting build script
10:37:19 AM: Installing dependencies
10:37:20 AM: Started restoring cached node version
10:37:21 AM: Finished restoring cached node version
10:37:22 AM: v8.16.0 is already installed.
10:37:23 AM: Now using node v8.16.0 (npm v6.4.1)
10:37:23 AM: Required ruby-2.4.2 is not installed.
10:37:23 AM: To install do: 'rvm install "ruby-2.4.2"'
10:37:23 AM: Attempting ruby version 2.4.2, read from .ruby-version file
10:37:23 AM: Started restoring cached ruby version
10:37:24 AM: Finished restoring cached ruby version
10:37:25 AM: Using ruby version 2.4.2
10:37:33 AM: Successfully installed bundler-2.0.2
10:37:33 AM: Parsing documentation for bundler-2.0.2
10:37:33 AM: Installing ri documentation for bundler-2.0.2
10:37:33 AM: Done installing documentation for bundler after 6 seconds
10:37:33 AM: 1 gem installed
10:37:33 AM: Using PHP version 5.6
10:37:33 AM: Started restoring cached ruby gems
10:37:33 AM: Finished restoring cached ruby gems
10:37:33 AM: Started restoring cached go cache
10:37:35 AM: Finished restoring cached go cache
10:37:35 AM: Installing Go version 1.10
10:37:37 AM: failed during stage 'building site': Build script returned non-zero exit code: 42
10:37:35 AM: unset GOOS;
10:37:37 AM: Shutting down logging, 30 messages pending

```

**Please provide a link to your live site hosted on Netlify**

> **[Introduction to Data Science](https://scientistcafe.com/ids/)**
>
> Introduction to Data Science

**What have you tried as far as troubleshooting goes? Do you have an idea what is causing the problem?**

I have no idea what causes the problem. : ( it has been ok and I didn’t change anything.

---

<div class="post-metadata">

**Author:** ![happyrabbit](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/happyrabbit/32/1272_2.png) [@happyrabbit](https://answers.netlify.com/u/happyrabbit)\
**Post date:** [June 18, 2019, 6:05pm UTC](https://answers.netlify.com/t/failed-during-stage-building-site/1488/2 "2019-06-18T18:05:55Z")

</div>

This is solved (Thank you very much @Laura Jodz (Netlify) ). In case other people have similar problem. Here is what you can do to debug.

This is the instruction from Laura:

 ![04%20AM](https://global.discourse-cdn.com/netlify/original/2X/8/86a8dce6b9e4725990f96e1a47084850009a0165.png)

I changed the build command and got the logs. It indicated the problem of `blunder` version:

```auto
10:47:44 AM: Activating bundler (2.0.1) failed:

10:47:44 AM: Could not find 'bundler' (= 2.0.1) - did find: [bundler-2.0.2]

```

So I went back to change the `Gemfile.lock` file to set:

```auto
BUNDLED WITH
   2.0.2

```

then followed the suggestion from this doc: [Build troubleshooting tips | Netlify Docs](https://www.netlify.com/docs/build-gotchas/) to run a build locally to make sure everything is ok then pushed to GitHub. Problem solved!!

---

<div class="post-metadata">

**Author:** ![laura](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/laura/32/6274_2.png) [@laura](https://answers.netlify.com/u/laura)\
**Post date:** [June 20, 2019, 6:37pm UTC](https://answers.netlify.com/t/failed-during-stage-building-site/1488/3 "2019-06-20T18:37:33Z")

</div>

@happyrabbit So glad to hear that helped you in your debugging!

---

<div class="post-metadata">

**Author:** ![acandael](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/acandael/32/6447_2.png) [@acandael](https://answers.netlify.com/u/acandael)\
**Post date:** [March 22, 2020, 12:29pm UTC](https://answers.netlify.com/t/failed-during-stage-building-site/1488/4 "2020-03-22T12:29:16Z")

</div>

HI Happyrabbit, I had exactly the same problem as you had. Changing the bundler version in Gemfile.lock fixed the issue.
