Questions and discussions about using the Shopify CLI and Shopify-built libraries.
This is the error
a@virt:~$ sudo gem install shopify-cli
Building native extensions. This could take a while...
ERROR: Error installing shopify-cli:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.7.0/gems/nokogumbo-2.0.5/ext/nokogumbo
/usr/bin/ruby2.7 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20210713-4999-j4vubf.rb extconf.rb
checking for whether -I/var/lib/gems/2.7.0/gems/nokogiri-1.11.7-x86_64-linux/ext/nokogiri is accepted as CFLAGS... *** 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/bin/$(RUBY_BASE_NAME)2.7
--with-libxml2
--without-libxml2
/usr/lib/ruby/2.7.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/2.7.0/mkmf.rb:597:in `block in try_compile'
from /usr/lib/ruby/2.7.0/mkmf.rb:544:in `with_werror'
from /usr/lib/ruby/2.7.0/mkmf.rb:597:in `try_compile'
from /usr/lib/ruby/2.7.0/mkmf.rb:661:in `try_cflags'
from /usr/lib/ruby/2.7.0/mkmf.rb:667:in `block (2 levels) in append_cflags'
from /usr/lib/ruby/2.7.0/mkmf.rb:971:in `block in checking_for'
from /usr/lib/ruby/2.7.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /usr/lib/ruby/2.7.0/mkmf.rb:331:in `open'
from /usr/lib/ruby/2.7.0/mkmf.rb:361:in `block in postpone'
from /usr/lib/ruby/2.7.0/mkmf.rb:331:in `open'
from /usr/lib/ruby/2.7.0/mkmf.rb:357:in `postpone'
from /usr/lib/ruby/2.7.0/mkmf.rb:970:in `checking_for'
from /usr/lib/ruby/2.7.0/mkmf.rb:666:in `block in append_cflags'
from /usr/lib/ruby/2.7.0/mkmf.rb:665:in `each'
from /usr/lib/ruby/2.7.0/mkmf.rb:665:in `append_cflags'
from extconf.rb:76:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/nokogumbo-2.0.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.7.0/gems/nokogumbo-2.0.5 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/nokogumbo-2.0.5/gem_make.out
and the mkmf.log contains
"x86_64-linux-gnu-gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/ruby2.7-3WGs5v/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -std=c99 conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -lruby-2.7 -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
Please help me install this tool On LinuxMint
P.S. the same happens on newest Ubuntu.
Just had to install make and gcc
I have exactly the same issue. Were you able to find a solution?
The only thing I did differently is that I used the apt package manager to do the install.
As per the instructions:
1. I downloaded the .deb file file from the github repo (version 2.2.2)
2. I ran the command to install the .deb
3. Installation ran and I got exit code 1
sudo apt install ruby-dev
OR
sudo apt install ruby-devel
afterwards try to reinstall shopify
Thanks ,
The issue is solved after installing ruby-dev