How to fix installation error with Shopify CLI on Ubuntu 22.04?

Topic summary

A user encountered an installation error when trying to install Shopify CLI on Ubuntu 22.04 from a .deb file obtained from Shopify’s GitHub page.

Error Details:

  • Failed to build gem native extension
  • Missing Ruby header files at /usr/lib/ruby/include/ruby
  • Suggested missing Ruby development environment packages (ruby-dev or ruby-devel)

Solution Provided:
Another user suggested the issue stemmed from Ruby not being installed and recommended:

  • Installing Ruby using sudo apt update and sudo apt install ruby-full
  • Installing additional development dependencies including build-essential, git, curl, autoconf, bison, and various library development packages (libssl-dev, libyaml-dev, libreadline6-dev, zlib1g-dev, libgdbm-dev, libdb-dev, libffi-dev)

Outcome:
The original poster confirmed the solution worked, though their final message appears incomplete or garbled, suggesting possible continued minor confusion.

Summarized with AI on November 23. AI used: claude-sonnet-4-5-20250929.

I’m encountering an issue while trying to install Shopify CLI on Ubuntu 22.04 and need help resolving it. I’ve obtained the .deb file from Shopify’s GitHub page, but upon attempting to install it, I receive an error.

ERROR:  Error installing shopify-cli:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.7.0/gems/ffi-1.15.4/ext/ffi_c
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20211012-33803-1ymrqv7.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Hi @panpert

This is Kate from PageFly - Landing page builder, I’d like to suggest this idea:

I think you don’t have Ruby installed. Here is how to install and you can try to fix:

sudo apt update
sudo apt install ruby-full

ruby --version

sudo apt update
sudo apt install git curl autoconf bison build-essential \
    libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
    libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev

Hope my answer will help you!

1 Like

Thank. Finally okay. Yet I kept getting confused :slightly_smiling_face: