asdf-vm / asdf-vm/asdf-ruby

Switching back to ruby 2.6 after installing / using 2.7 - strange ruby errors

Open
#154 13 comments 14 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
734
Forks
156
Avg merge
17h 6m
Merged PRs (30d)
1

Description

When I try to switch back to `asdf local ruby 2.6.5` after having been in `2.7.0` ruby no longer works. I've tried removing / re-adding the ruby plugin, I've tried updating asdf, and I've tried reinstalling 2.6.5, and nothing works, giving me a strange error I can't get any google results about

```
% asdf exec ruby -v
Traceback (most recent call last):
/Users/joemsak/.asdf/installs/ruby/2.6.5/bin/ruby: invalid option -: (-h will show valid options) (RuntimeError)
```

```
% asdf install ruby 2.6.5
Downloading ruby-build...
Cloning into '/Users/joemsak/.asdf/plugins/ruby/ruby-build-source'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 10245 (delta 0), reused 0 (delta 0), pack-reused 10244
Receiving objects: 100% (10245/10245), 2.16 MiB | 300.00 KiB/s, done.
Resolving deltas: 100% (6667/6667), done.
Note: switching to 'v20191225'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c937a09 ruby-build 20191225
Downloading openssl-1.1.1d.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
Installing openssl-1.1.1d...
Installed openssl-1.1.1d to /Users/joemsak/.asdf/installs/ruby/2.6.5

Downloading ruby-2.6.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Installing ruby-2.6.5...
ruby-build: using readline from homebrew
Installed ruby-2.6.5 to /Users/joemsak/.asdf/installs/ruby/2.6.5

Running: gem install bundler: --version 1.17.3 ... FAIL: /Users/joemsak/.asdf/installs/ruby/2.6.5/bin/ruby: invalid option -: (-h will show valid options) (RuntimeError)
kadenzeweb upgrade-rails % asdf reshim ruby
kadenzeweb upgrade-rails % ruby -v
Traceback (most recent call last):
/Users/joemsak/.asdf/installs/ruby/2.6.5/bin/ruby: invalid option -: (-h will show valid options) (RuntimeError)
```

(my .gemrc locks bundler to 1.17.3, for rails 4.2)

I have no idea what to do, the last time I got stuck like this was a week or so ago and I reinstalled my entire OS as a result (macOS Catalina)

Thanks for your time!

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.