# Cannot Build App in Production - mysql2

**URL:** https://meta.discourse.org/t/cannot-build-app-in-production-mysql2/112182
**Category:** Support
**Created:** [March 20, 2019, 8:05pm UTC](https://meta.discourse.org/t/cannot-build-app-in-production-mysql2/112182 "2019-03-20T20:05:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Alfarhan\_Zahedi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alfarhan_zahedi/32/141591_2.png) [@Alfarhan\_Zahedi](https://meta.discourse.org/u/Alfarhan_Zahedi)
#### Post date: [March 20, 2019, 8:05pm UTC](https://meta.discourse.org/t/cannot-build-app-in-production-mysql2/112182/1 "2019-03-20T20:05:15Z")

</div>

I wrote a plugin which uses the mysql2 gem. The rebuilding of app fails with the error:

```plaintext
mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.

```

What do I need to do to get past this ? How do I run `apt-get install libmysqlclient-dev` before the gem is installed ?

---

<div class="post-metadata">

### Author: ![Alfarhan\_Zahedi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alfarhan_zahedi/32/141591_2.png) [@Alfarhan\_Zahedi](https://meta.discourse.org/u/Alfarhan_Zahedi)
#### Post date: [March 20, 2019, 8:07pm UTC](https://meta.discourse.org/t/cannot-build-app-in-production-mysql2/112182/2 "2019-03-20T20:07:20Z")

</div>

I have edited `app.yml` to include the command `apt-get install libmysqlclient-dev` in the `after_code` section. Hope that works.

Edit: It worked!

---

<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: [April 19, 2019, 8:07pm UTC](https://meta.discourse.org/t/cannot-build-app-in-production-mysql2/112182/3 "2019-04-19T20:07:32Z")

</div>

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