Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

use rbenv instead of chruby for consistency with repo code #188

Open
bleachbyte opened this issue Sep 24, 2019 · 4 comments
Open

use rbenv instead of chruby for consistency with repo code #188

bleachbyte opened this issue Sep 24, 2019 · 4 comments

Comments

@bleachbyte
Copy link

Despite this note...

fancy_echo 'We recommend chruby and ruby-install over RVM or rbenv'

...there doesn't appear to be a specific reason that this script uses chruby/ruby-install over rbenv. In addition:

  • the rbenv binary appears in numerous places throughout our code, while the chruby one does not
  • chruby allows for fuzzy-version installs, which can potentially be problematic if the third version octet isn't specified
  • switch_to_latest_ruby() is dependent on /usr/local/share/chruby/chruby.sh existing, despite the fact that an installer, and support, for rbenv (currently just with fish) exists in the file

Unless there's a specific infrastructure reason for staying with chruby over rbenv I believe it would make more sense to just use the rbenv installation process, possibly coupled with some extra commands to easily set up aliases for the various .ruby-version files.

@jgrevich
Copy link

+1 in favor of simplifying this and using rbenv by default. Let's let Andy make the final call.

@mgwalker
Copy link
Contributor

Some historical context: The switch to chruby was a long time ago, and apparently in response to a particular problem with RVM. I can't find any discussion in Slack about it, except one 8 months ago where we agreed that if people are using something else, we should update the script. Incidentally, in that conversation, most people said they are using rbenv. 😛

@adborden
Copy link
Contributor

adborden commented Sep 30, 2019 via email

@monfresh
Copy link
Contributor

monfresh commented Sep 30, 2019

Given I introduced chruby here, I thought I'd add my thoughts as well. Feel free to ignore them 😄

It looks like rbenv was introduced in this script because chruby supposedly doesn't work with the fish shell. That has not been my experience. I have been using chruby with fish for about a year now without any issues. Here is how you can get chruby to work in fish:

  • brew install chruby-fish
  • Add the following lines to ~/.config/fish/config.fish:
source /usr/local/share/chruby/chruby.fish
source /usr/local/share/chruby/auto.fish
chruby ruby-2.6.4 (or whatever you want your default to be)

If you are switching to fish from bash, you also need to delete or empty your .bash_profile, as it may still contain things that might conflict with fish and/or chruby.

As for choosing chruby, it was for the following reasons:

  • it is the smallest and easiest to understand compared to RVM and rbenv.

  • it does not do some of the things that other tools do:

    • Does not hook cd.
    • Does not install executable shims.
    • Does not require Rubies to be installed into your home directory.
    • Does not automatically switch Rubies by default.

References:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants