postmodern / chruby

Changes the current Ruby
MIT License
2.85k stars 190 forks source link

Allow ability to set RUBYOPT when auto-switching #430

Open ordinaryzelig opened 4 years ago

ordinaryzelig commented 4 years ago

chruby command line allows setting of RUBYOPT, but auto-switching is limited to only the ruby argument. Would be nice to somehow allow the addition of these options when auto-switching. Quickly tried to add them to .ruby-version, but after looking at the auth.sh script, the file contents are taken literally as only the ruby version.

chadbailey59 commented 4 years ago

+1 to this. I'm trying to use chruby ruby-2.7.0 -W:no-deprecated -W:no-experimental to suppress a lot of Rails-related deprecation warnings. That works fine on the command line, but there's currently no way to replicate that in a .ruby-version file. I get that .ruby-version is supposed to be an agnostic format, but I'm posting this to subscribe in case anyone has a better idea. :)

maxhollmann commented 4 years ago

I'm working around this issue by invoking chruby from direnv instead of using the zsh plugin for now.