# CMake missing when adding discourse-code-review, sometimes

**URL:** https://meta.discourse.org/t/cmake-missing-when-adding-discourse-code-review-sometimes/155592
**Category:** Support
**Created:** [June 22, 2020, 5:50pm UTC](https://meta.discourse.org/t/cmake-missing-when-adding-discourse-code-review-sometimes/155592 "2020-06-22T17:50:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 22, 2020, 5:50pm UTC](https://meta.discourse.org/t/cmake-missing-when-adding-discourse-code-review-sometimes/155592/1 "2020-06-22T17:50:38Z")

</div>

This seems similar to [ERROR: CMake is required to build Rugged](https://meta.discourse.org/t/error-cmake-is-required-to-build-rugged/142900), but I just tried a bootstrap and it failed if I didn’t do

```plaintext
  before_code:
    - exec:
        cd: $home
        cmd:
          - apt update
          - apt -y install cmake

```

It failed like this.

```plaintext
I, [2020-06-22T17:13:16.381492 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'    
ERROR: Error installing rugged:
        ERROR: Failed to build gem native extension.            
                                                                                                           
    current directory: /var/www/discourse/plugins/discourse-code-review/gems/2.6.5/gems/rugged-0.28.4.1/ext/rugged
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200622-21455-f9skgp.rb extconf.rb
checking for gmake... no                
checking for make... yes
checking for cmake... no
ERROR: CMake is required to build Rugged.
***extconf.rb failed***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
        --with-sha1dc
        --without-sha1dc
        --use-system-libraries

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/www/discourse/plugins/discourse-code-review/gems/2.6.5/extensions/x86_64-linux/2.6.0-static/rugged-0.28.4.1/mkmf.lo
g

extconf failed, exit code 1

```

But on another system I was able to add the plugin without it. Both are fairly standard `web_only.yml` (broken one launches to kubernetes, the working one has traefik as reverse proxy, but I don’t see how that would affect whether bootstrap would run!).

Just leaving this in case my workaround will help someone else or someone who knows something will recognize something that should be changed.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [June 22, 2020, 6:11pm UTC](https://meta.discourse.org/t/cmake-missing-when-adding-discourse-code-review-sometimes/155592/2 "2020-06-22T18:11:04Z")

</div>

Latest image already contains `cmake` installed. Are you stuck on a old image? A rebuild does the update.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 22, 2020, 6:41pm UTC](https://meta.discourse.org/t/cmake-missing-when-adding-discourse-code-review-sometimes/155592/3 "2020-06-22T18:41:41Z")

</div>

Aha. `rebuild` does an update, but `bootstrap` does not. And on the other system, I’d done a rebuild for something more recently. That explains it, and I guess I need to go double-check that my bootstraps are doing a `git pull`.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 22, 2020, 6:41pm UTC](https://meta.discourse.org/t/cmake-missing-when-adding-discourse-code-review-sometimes/155592/4 "2020-07-22T18:41:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
