Shopify-CLI instructing me to run `bundle install` but where is the Gemfile?

Solved

Shopify-CLI instructing me to run `bundle install` but where is the Gemfile?

masebase
Tourist
11 3 6

Once Shopify-CLI forced the upgrade to a newer Ruby version, I have been having a ton of challenges. 

Finally got Ruby 3.3.0 installed so that Shopify-CLI could run.

I also updated the Shopify-CLI plugin. 

$ brew info shopify-cli
==> shopify/shopify/shopify-cli: stable 3.59.1
A CLI tool to build for the Shopify platform
https://github.com/shopify/cli#readme
Installed
/usr/local/Cellar/shopify-cli/3.59.1 (892 files, 39.8MB)
  Built from source on 2024-04-29 at 15:43:38
From: https://github.com/shopify/homebrew-shopify/blob/HEAD/shopify-cli.rb
License: MIT
==> Dependencies
Required: node ✔, ruby ✔, git ✔

Now when I try to run `shopify theme pull` I get this:

Could not find bugsnag-6.24.2, concurrent-ruby-1.1.10, rb-fsevent-0.11.1, ffi-1.15.4 in locally installed gems
Run `bundle install` to install missing gems.

 

But there is no local Gemfile in my local directory where I want to pull my theme. So running `bundle install` gives me this: 

Could not locate Gemfile

 

I'm on Mac w/ an Apple M1 chip running MacOS Sonoma 14.4.1

Accepted Solution (1)

masebase
Tourist
11 3 6

This is an accepted solution.

So I've somehow gotten it working, but I'm not certain what was THE thing that resolved my issues. Here are a few things I did (not in order). Sorry I can't retrace the exact sequence but hopefully this can help others...

 

First I uninstalled Shopify CLI, thinking it may have been confused since it was installed prior to my successful Ruby 3.3.0 build.

$ brew uninstall shopify-cli

 

I did a cleanup of homebrew, which appeared to have some broken symlinks from struggles in getting Ruby 3.3.0 installed, built, and working for `rbenv`

 

$ brew cleanup

 

 

Then I made sure that rbenv was pointing to the new 3.3.0 version, since I had previously received warning messages from Shopify CLI that older versions of Ruby were no longer suppored.

$ rbenv versions
  system
* 2.7.1 (set by /Users/username/dev/Shopify/ess/.ruby-version)
  3.3.0

$ rbenv global 3.3.0

$ rbenv versions
  system
  2.7.1
* 3.3.0 (set by /Users/username/dev/Shopify/ess/.ruby-version)

 

I then reinstalled Shopify CLI

$ brew install shopify-cli

 

Now somehow I don't have the `bundle install` errors and I can run `shopify theme dev` or `shopify theme pull` successfully

View solution in original post

Replies 7 (7)

mikelyons
Tourist
3 0 1

I am having the same issue, when I run it with the suggested gemfile in the shopify cli path it installs the gems but then `shopify theme dev` throws the same error again as if the gems didn't install.

masebase
Tourist
11 3 6

Are you also using `rbenv` to manage different ruby versions / environments? 

I was wondering if this might be part of the cause for me

mikelyons
Tourist
3 0 1

Yes I am using rbenv

masebase
Tourist
11 3 6

This is an accepted solution.

So I've somehow gotten it working, but I'm not certain what was THE thing that resolved my issues. Here are a few things I did (not in order). Sorry I can't retrace the exact sequence but hopefully this can help others...

 

First I uninstalled Shopify CLI, thinking it may have been confused since it was installed prior to my successful Ruby 3.3.0 build.

$ brew uninstall shopify-cli

 

I did a cleanup of homebrew, which appeared to have some broken symlinks from struggles in getting Ruby 3.3.0 installed, built, and working for `rbenv`

 

$ brew cleanup

 

 

Then I made sure that rbenv was pointing to the new 3.3.0 version, since I had previously received warning messages from Shopify CLI that older versions of Ruby were no longer suppored.

$ rbenv versions
  system
* 2.7.1 (set by /Users/username/dev/Shopify/ess/.ruby-version)
  3.3.0

$ rbenv global 3.3.0

$ rbenv versions
  system
  2.7.1
* 3.3.0 (set by /Users/username/dev/Shopify/ess/.ruby-version)

 

I then reinstalled Shopify CLI

$ brew install shopify-cli

 

Now somehow I don't have the `bundle install` errors and I can run `shopify theme dev` or `shopify theme pull` successfully

mikelyons
Tourist
3 0 1

I tried uninstalling, upgrading to ruby 3.3.0 and then installing shopify cli, but the same error is still occurring. Maybe it has to do with installing shopify cli with npm instead of homebrew (I'm on debian wsl on windows 10)

calebhailey
Shopify Partner
1 0 0

I was having this same issue running shopify theme dev and your suggested solution helped me resolve it, but as far as I can tell it didn't have anything to do w/ the shopify cli install. 

 

Here's the error I was seeing: 

 

 

$ shopify theme dev --store xxxxxxxxxx
── external error ─────────────────────────────────────────────────────────────────────────

Error coming from `bundle install`

Command failed with exit code 1: bundle install
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find
'bundler' (2.3.20) required by your /Users/calebhailey/.nodejs/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/Gemfile.lock.
(Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.3.20`
        from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
        from /usr/local/bin/bundle:23:in `<main>'

───────────────────────────────────────────────────────────────────────────────────────────

 

 

 

Some details about my setup: 

 

  • macos 14.2.x
  • nodejs 20.11.0 
  • shopify cli installed via npm install -g @Shopify/cli
  • rbenv for managing ruby versions

 

I had my local .ruby-version set to 3.3.1, but I noticed the error message referenced the system Ruby (on macOS 14 that's ruby 2.6). For me all that was needed was setting rbenv global 3.3.1 and rerunning the `shopify theme dev` command, and the issue was resolved. 

 

The error message also explains exactly where the mysterious Gemfile comes from:

 

 

 

$(npm config get prefix)/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/Gemfile.lock

 

 

 

Hope this helps! 😊 

mike_cocoapps
Shopify Partner
1 0 0

Same issue using ruby 3.0.6 running yarn dev on an application, it only occurs when I add on the toml file the theme app extension directory

 

* extension_directories = [ "shopify_extensions/*"]

 

Could not find bugsnag-6.24.2, listen-3.7.1, concurrent-ruby-1.1.10, rb-fsevent-0.11.1, rb-inotify-0.10.1, ffi-1.15.4 in locally installed gems

 

 

Without theme app extension the app runs successfully

 

I am using chruby for Ruby environment