w4ll3
(Gregório Granado Magalhães)
March 3, 2022, 3:21pm
1
Hello! I’m developing a plugin to enable Sign-In with Ethereum on Discourse. The problem is that when installing the plugin I get an error with one of the dependencies (rbsecp256k1).
ERROR: Error installing rbsecp256k1:
ERROR: Failed to build gem native extension.
current directory: /var/www/discourse/plugins/sdp/gems/2.7.5/gems/rbsecp256k1-5.1.0/ext/rbsecp256k1
/usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.7.0 -r ./siteconf20220303-1234-gyqjb.rb extconf.rb
extconf.rb:3:in `require': cannot load such file -- mini_portile2 (LoadError)
from extconf.rb:3:in `<main>'
extconf failed, exit code 1
I wonder what might be happening since it works on development if I manually install the dependencies.
Falco
(Falco)
March 3, 2022, 3:31pm
2
That gem has OS-level dependencies that you need to have installed, according to their documentation: GitHub - etscrivner/rbsecp256k1: Compiled Ruby wrapper around libsecp256k1 for secp256k1 ECDSA.
w4ll3
(Gregório Granado Magalhães)
March 3, 2022, 3:34pm
3
Yeah, I have those installed already the problem happens when it can’t find mini_portile2
, which is one of it’s dependency
1 Like
Falco
(Falco)
March 3, 2022, 3:36pm
4
How did you declare the mini_portile2
dependency on your plugin?
1 Like
fzngagan
(Faizaan Gagan)
March 3, 2022, 3:51pm
5
I’ve experienced the same issue installing the same gem dependency.
Take a look
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.
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: fals…
I would love it if there was a more straightfwd solution.
2 Likes
Falco
(Falco)
March 3, 2022, 4:47pm
7
Can’t you just drop that since it’s already in Discourse core?
mini_racer (0.9.0)
libv8-node (~> 18.19.0.0)
mini_scheduler (0.16.0)
sidekiq (>= 4.2.3, < 7.0)
mini_sql (1.5.0)
mini_suffix (0.3.3)
ffi (~> 1.9)
minio_runner (0.1.2)
minitest (5.23.1)
mocha (2.3.0)
ruby2_keywords (>= 0.0.5)
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mustache (1.1.1)
mutex_m (0.2.0)
net-http (0.4.1)
uri
net-imap (0.4.12)
date
1 Like
w4ll3
(Gregório Granado Magalhães)
March 3, 2022, 5:03pm
8
I mean, I can but the problem is not with that gem the problem is with rbsecp256k1
, when it tries to build it doesn’t find the mini_portile2
gem (As the error says: cannot load such file -- mini_portile2 (LoadError) from extconf.rb:3:in <main>'
You are going over the same ground as @fzngagan , see his link above: Having a hard time installing `eth` gem in a plugin in production - #3 by fzngagan , perhaps you can contribute to his solution.
w4ll3
(Gregório Granado Magalhães)
March 3, 2022, 5:29pm
10
His solution works, but I don’t consider that a valid option, no user would be willing to do all of that just to add a plugin. I just wanted to know if someone could think of a better approach (the closest to just add the repo and you’re good to go). as @fzngagan himself said:
I would love it if there was a more straightfwd solution.
And now we have two Topics on the exact same problem …
1 Like
w4ll3
(Gregório Granado Magalhães)
March 3, 2022, 9:56pm
12
I’ve been narrowing it down, it doesn’t seem related to the gems, it seems to be related to extconf.rb
. I tried with other few gems with a more complex setup (ruby-magic
and libusb
), both doesn’t work (for different reason) all they have in common are dependencies at extconf.rb
.
1 Like
fzngagan
(Faizaan Gagan)
March 14, 2022, 7:43am
13
This issue has been fixed on the latest tests-passed
and stable
branches of discourse.
committed 05:20AM - 07 Mar 22 UTC
when bundler is loaded, it sets the `RUBYOPT` environment variable to setup bund… ler. However, it was causing weird errors like the following when we try to install
custom plugin gems into a specific directory.
```
/home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:214:in `rescue in load_spec_files': https://github.com/discourse/mail.git is not yet checked out. Run `bundle install` first. (Bundler::GitError)
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:210:in `load_spec_files'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/path.rb:107:in `local_specs'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:178:in `specs'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/lazy_specification.rb:88:in `__materialize__'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec_set.rb:75:in `block in materialize'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec_set.rb:72:in `map!'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec_set.rb:72:in `materialize'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:468:in `materialize'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:190:in `specs'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:238:in `specs_for'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/runtime.rb:18:in `setup'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler.rb:151:in `setup'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in `block in <top (required)>'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:136:in `with_level'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:88:in `silence'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in `<top (required)>'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
```
discourse:stable
← tgxworld:backport
opened 07:11AM - 14 Mar 22 UTC
when bundler is loaded, it sets the `RUBYOPT` environment variable to setup bund… ler. However, it was causing weird errors like the following when we try to install
custom plugin gems into a specific directory.
```
/home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:214:in `rescue in load_spec_files': https://github.com/discourse/mail.git is not yet checked out. Run `bundle install` first. (Bundler::GitError)
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:210:in `load_spec_files'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/path.rb:107:in `local_specs'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/source/git.rb:178:in `specs'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/lazy_specification.rb:88:in `__materialize__'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec_set.rb:75:in `block in materialize'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec_set.rb:72:in `map!'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/spec_set.rb:72:in `materialize'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:468:in `materialize'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:190:in `specs'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/definition.rb:238:in `specs_for'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/runtime.rb:18:in `setup'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler.rb:151:in `setup'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in `block in <top (required)>'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:136:in `with_level'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/ui/shell.rb:88:in `silence'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/bundler-2.3.5/lib/bundler/setup.rb:20:in `<top (required)>'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /home/tgxworld/.asdf/installs/ruby/2.7.5/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
```
2 Likes
RGJ
(Richard - Communiteq)
March 14, 2022, 5:39pm
14
fzngagan:
stable
Not yet, the PR is not merged yet.
1 Like
fzngagan
(Faizaan Gagan)
March 18, 2022, 6:09am
18
@RGJ There were some test failures that needed to be address first. Its merged now.
2 Likes