# Having a hard time installing \`eth\` gem in a plugin in production

**URL:** https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496
**Category:** Development
**Created:** [February 8, 2022, 11:54am UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496 "2022-02-08T11:54:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [February 8, 2022, 11:54am UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/1 "2022-02-08T11:54:21Z")

</div>

I’m having to install the `eth` gem in a plugin but really having a hard time doing that. It depends on a bunch of other gems, a few of which have native extensions. Here’s the dependency list if you wanna give it a try.

```plaintext
gem 'pkg-config', '1.4.7', require: false
gem 'mkmfmf', '0.4', require: false
gem 'keccak', '1.3.0', require: false
gem 'zip', '2.0.2', require: false
gem 'mini_portile2', '2.7.0', require: false
gem 'rbsecp256k1', '5.1.0', require: false
gem 'konstructor', '1.0.2', require: false
gem 'ffi', '1.15.5', require: false
gem 'ffi-compiler', '1.0.1', require: false
gem 'scrypt', '3.0.7', require: false
gem 'eth', '0.5.1', require: false
gem 'siwe', '1.0.0', require: false

```

The issue is with `rbsecp256k1`. It tries to require `mini_portile2` for building its native extensions but can’t find it inspite of it being installed and `require`d. I’ve gone to great lengths, like forking the gem and requiring the absolute path manually, also tried to literally clone the `mini_portile2` into `rbsecp256k1` and requiring it from there but nothing has worked yet.

Any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [February 8, 2022, 3:28pm UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/2 "2022-02-08T15:28:30Z")

</div>

I finally managed to find a workaround. I’ll share in a bit.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [February 8, 2022, 5:56pm UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/3 "2022-02-08T17:56:02Z")

</div>

Here’s what I did. I logged in to the server and entered the docker container.

- create a folder called `gems`

- create a subdirectory `2.7.5` (ruby version used by production discourse on `tests-passed`)

- cd back to `gems` folder

- Run commands in this fashion

- Now zip this folder.

- Exit the docker container and copy the zip outside the docker container using `docker cp` command.

- Connect to your server via filezilla or vscode and download the zip.

- extract it to the root folder of your plugin. So your plugin folder would now have the gems directory.

- Now push the gems folder with the plugin to github.

Now when you do a rebuild on discourse with this plugin, discourse will use the dependencies you supplied it and won’t try to install them. This is a temporary workaround and would need to be re-done once discourse bumps the ruby version.

But here’s the big question, why do the same commands that work when running from the terminal fail when discourse tries to run it. It would be really worth looking into and I hope there’s a simple fix.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 10, 2022, 7:39am UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/4 "2022-03-10T07:39:20Z")

</div>

> [@fzngagan](#):
>
> why do the same commands that work when running from the terminal fail when discourse tries to run it.

I fixed this recently in

[https://github.com/discourse/discourse/commit/6b8c622762571a9012cb1805f04b6b2593526021](https://github.com/discourse/discourse/commit/6b8c622762571a9012cb1805f04b6b2593526021)

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [March 10, 2022, 7:41am UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/5 "2022-03-10T07:41:11Z")

</div>

> [@tgxworld](#):
>
> I fixed this recently in

Awesome, Thanks. 👏

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 11, 2022, 9:07am UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/6 "2022-03-11T09:07:03Z")

</div>

Would you be able to cherry pick this fix to `stable` @tgxworld ?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 14, 2022, 7:12am UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496/7 "2022-03-14T07:12:28Z")

</div>

Have done so in

[https://github.com/discourse/discourse/pull/16176](https://github.com/discourse/discourse/pull/16176)
