asdf-vm / asdf-vm/asdf-ruby

Using `brew bundle exec bundle install` fails during post install due to not finding asdf

Open
#291 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
734
Forks
156
Avg merge
17h 6m
Merged PRs (30d)
1

Description

I've often had success with [brew bundle](https://github.com/Homebrew/homebrew-bundle) to specify macOS dependencies, and then using `brew bundle exec bundle install` to make sure the build env has everything set in there. This is a way to make sure `mysql2` gem finds the mysql libraries, for example. [Bundle Install With Homebrew Magic Using Brew Bundle Exec](https://www.mistys-internet.website/blog/blog/2020/11/23/bundle-install-with-homebrew-magic-using-brew-bundle-exec/) does a really good job explaining this pattern.

I've had problems doing this since switching to asdf. I'm including the output from `brew bundle exec bundle install` at the bottom of this issue, which is conveniently already formatted for markdown 😁

Some details that might be relevant:

```
❯ asdf --version
v0.10.2

❯ asdf plugin list --urls | grep ruby
ruby https://github.com/asdf-vm/asdf-ruby.git

❯ asdf plugin list --refs | grep ruby
ruby master a1352b4
```

The workaround I've found is to run `bundle install` without `brew bundle exec` to make sure it succeeds.

## Backtrace

```
Errno::ENOENT: No such file or directory - asdf
/Users/josh.nichols/.asdf/plugins/ruby/rubygems-plugin/rubygems_plugin.rb:5:in ``'
/Users/josh.nichols/.asdf/plugins/ruby/rubygems-plugin/rubygems_plugin.rb:5:in `install'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/installer.rb:89:in `block in run'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/process_lock.rb:12:in `block in lock'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/process_lock.rb:9:in `open'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/process_lock.rb:9:in `lock'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/installer.rb:71:in `run'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/installer.rb:23:in `install'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/cli/install.rb:60:in `run'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/cli.rb:253:in `block in install'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/settings.rb:131:in `temporary'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/cli.rb:252:in `install'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/cli.rb:31:in `dispatch'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/cli.rb:25:in `start'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/exe/bundle:49:in `block in '
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/bundler-2.2.29/exe/bundle:37:in `'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/bin/bundle:25:in `load'
/Users/josh.nichols/.asdf/installs/ruby/2.7.6/bin/bundle:25:in `'
```

## Environment

```
Bundler 2.2.29
Platforms ruby, arm64-darwin-21
Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd) [arm64-darwin21]
Full Path /Users/josh.nichols/.asdf/installs/ruby/2.7.6/bin/ruby
Config Dir /Users/josh.nichols/.asdf/installs/ruby/2.7.6/etc
RubyGems 3.3.19
Gem Home /Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0
Gem Path /Users/josh.nichols/.gem/ruby/2.7.0:/Users/josh.nichols/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0
User Home /Users/josh.nichols
User Path /Users/josh.nichols/.gem/ruby/2.7.0
Bin Dir /Users/josh.nichols/.asdf/installs/ruby/2.7.6/bin
OpenSSL
Compiled OpenSSL 1.1.1n 15 Mar 2022
Loaded OpenSSL 1.1.1n 15 Mar 2022
Cert File /Users/josh.nichols/.asdf/installs/ruby/2.7.6/openssl/ssl/cert.pem
Cert Dir /Users/josh.nichols/.asdf/installs/ruby/2.7.6/openssl/ssl/certs
Tools
Git 2.37.1
RVM not installed
rbenv not installed
chruby not installed
```

## Bundler Build Metadata

```
Built At 2021-10-08
Git SHA 4440b035ef
Released Version true
```

## Bundler settings

```
force_ruby_platform
Set for the current user (/Users/josh.nichols/.bundle/config): true
unset
Set for the current user (/Users/josh.nichols/.bundle/config): "jobs"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.