Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Newly installed ruby not listed in chruby #74

Closed
teohm opened this Issue · 12 comments

3 participants

@teohm

After successfully installed a ruby version using ruby-build, chruby does not update the installed ruby list:

$ chruby
   jruby-1.7.2
   ruby-1.8.7-p371
 * ruby-1.9.3-p362

$ ruby-build -v 2.0.0-preview2 ~/.rubies/2.0.0-preview2
...
...
Installed ruby-2.0.0-preview2 to ~/.rubies/2.0.0-preview2

$ chruby
   jruby-1.7.2
   ruby-1.8.7-p371
 * ruby-1.9.3-p362

Currently, my workaround is to reopen a new terminal to see the updated list. Does it happen to anyone else here?

@postmodern
Owner

Yes, this is because chruby loads Rubies at startup. I could add a chruby_load function?

@teohm

Ya, that will be great!

Or is it possible to always reload the list, right before we run chruby to list the installed rubies?

@postmodern
Owner

Not currently, since users can explicitly define RUBIES with custom globs.

@teohm

I see, what chruby_load function that you suggested will do?

@postmodern
Owner

Probably just these two lines. chruby_load would then be called at the bottom of the script.

@teohm
@postmodern
Owner

ah good catch. I guess chruby_load should re-set RUBIES.

@postmodern
Owner

0.3.3 will initialize RUBIES to () on load. I will probably add a reload.sh or refresh.sh file in 0.4.0 that users can load; since not everyone installs Rubies on the fly.

@postmodern postmodern was assigned
@misfo misfo referenced this issue from a commit in misfo/chruby
@misfo misfo Expand file globs in RUBIES at runtime
This prevents the user from having to source chruby.sh whenever Ruby
installations are added or removed.

Fixes #74
b6d63ca
@nengxu

I'm still having this problem.

$ chruby --version
chruby version 0.3.4

I have to run this to get the newly installed ruby recognized by chruby:
source /usr/share/chruby/chruby.sh # archlinux

@postmodern
Owner

Sorry for the wait. There will be a chruby_install function in 0.4.0. Until then, simply restart the shell or re-load chruby.sh.

@postmodern
Owner

See #97.

@postmodern postmodern closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.