# How to install the bootsnap gem?

**URL:** https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600
**Category:** Development
**Created:** [25.Апрель.2017 21:44:37 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600 "2017-04-25T21:44:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [25.Апрель.2017 21:44:37 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/1 "2017-04-25T21:44:37Z")

</div>

@sam I managed to install the `snappy` gem by executing `apt install libsnappy-dev`, but I’m not sure what’s missing in order to install the `bootsnap` gem on my Ubuntu 16.10 machine. What’s the trick to get this working? 😉

I’m getting the following error:  
`error: enumerator value for ‘RUBY_FL_USER19’ is not an integer constant expression [-Werror=pedantic]`

The complete logfile:

```
current directory: /home/gerhard/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bootsnap-0.2.10/ext/bootsnap
/home/gerhard/.rbenv/versions/2.3.0/bin/ruby -r ./siteconf20170425-62270-exmesk.rb extconf.rb
creating Makefile

current directory: /home/gerhard/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bootsnap-0.2.10/ext/bootsnap
make "DESTDIR=" clean

current directory: /home/gerhard/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bootsnap-0.2.10/ext/bootsnap
make "DESTDIR="
compiling bootsnap.c
In file included from /home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby.h:33:0,
                 from bootsnap.h:6,
                 from bootsnap.c:1:
/home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:834:45: error: enumerator value for ‘RUBY_FL_USER19’ is not an integer constant expression [-Werror=pedantic]
 #define RUBY_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
                                             ^
/home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:855:5: note: in expansion of macro ‘RUBY_FL_USER_N’
     RUBY_FL_USER_N(19),
     ^ ~~~~~~~~~~~~~
In file included from /home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:1985:0,
                 from /home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby.h:33,
                 from bootsnap.h:6,
                 from bootsnap.c:1:
/home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/intern.h:922:29: error: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
 void rb_timespec_now(struct timespec *);
                             ^ ~~~~~~~
/home/gerhard/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/intern.h:925:41: error: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
 VALUE rb_time_timespec_new(const struct timespec *, int);
                                         ^ ~~~~~~~
cc1: error: unrecognized command line option ‘-Wno-keyword-macro’ [-Werror]
cc1: all warnings being treated as errors
Makefile:238: recipe for target 'bootsnap.o' failed
make: *** [bootsnap.o] Error 1

make failed, exit code 2

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25.Апрель.2017 21:57:26 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/2 "2017-04-25T21:57:26Z")

</div>

Ouch,

Do you mind opening this issue here:

> **[Issues · rails/bootsnap](https://github.com/rails/bootsnap/issues)**
>
> Boot large Ruby/Rails apps faster. Contribute to rails/bootsnap development by creating an account on GitHub.

I just commented bootsnap out for now ☹ Gemfile does not support a clean way to avoid installing a gem on a specific platform

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25.Апрель.2017 22:00:17 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/3 "2017-04-25T22:00:17Z")

</div>

Interesting, this installs fine on our CI and docker image.. I wonder if this is cause you are not using gcc?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [25.Апрель.2017 22:20:27 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/4 "2017-04-25T22:20:27Z")

</div>

Well, gcc is installed… Tomorrow I’ll take a closer look and test it in another VM.  
I’ll submit a bug report if it doesn’t work there either.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25.Апрель.2017 22:21:59 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/5 "2017-04-25T22:21:59Z")

</div>

A repro would be awesome, `@burke` has been super responsive.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [26.Апрель.2017 22:09:18 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/6 "2017-04-26T22:09:18Z")

</div>

I tried installing it on a fresh Ubuntu 17.04, but it fails with the same error.

[https://github.com/Shopify/bootsnap/issues/15](https://github.com/Shopify/bootsnap/issues/15)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [27.Апрель.2017 19:58:42 UTC](https://meta.discourse.org/t/how-to-install-the-bootsnap-gem/61600/7 "2017-04-27T19:58:42Z")

</div>

`@burke` fixed the problem in version 0.2.12. It’s now possible to install the `bootsnap` gem on Linux.

On Ubuntu developers must install the `libsnappy-dev` package, otherwise the installation of the `snappy` gem will fail.

I submitted a PR which updates the script used in the [Beginners Guide to Install Discourse on Ubuntu for Development](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727) accordingly.

[https://github.com/techAPJ/install-rails/pull/4](https://github.com/techAPJ/install-rails/pull/4)
