Comments (16)
Yes, this is because chruby loads Rubies at startup. I could add a chruby_load
function?
from chruby.
Ya, that will be great!
Or is it possible to always reload the list, right before we run chruby
to list the installed rubies?
from chruby.
Not currently, since users can explicitly define RUBIES
with custom globs.
from chruby.
I see, what chruby_load
function that you suggested will do?
from chruby.
Probably just these two lines. chruby_load
would then be called at the bottom of the script.
from chruby.
Ah I see, that should work.
BTW, as I don't explicitly define RUBIES myself, each time I run: source ~/.bashrc
, the items in RUBIES list will be doubled with duplicates.
from chruby.
ah good catch. I guess chruby_load
should re-set RUBIES
.
from chruby.
👍
from chruby.
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.
from chruby.
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
from chruby.
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
.
from chruby.
See #97.
from chruby.
Is this functionality still on the road map?
from chruby.
@hedgehog we'd have to replace $RUBIES
with $RUBIES_DIRS
or something similar, so not happening until 1.0.
from chruby.
This kept annoying me, and I couldn't wait, so I decided to just do it myself. I put this in my .zshrc
(and I'm sure it can be adapted to other shells, too, though you might want to double check that the inlined Ruby code works for any version of Ruby you're likely to use or use an absolute path with a predictable Ruby version floor on your system):
chruby-reload () {
eval "RUBIES=($(
ruby -rshellwords -e '
puts STDIN.read
.split("\n")
.grep_v(/^$/) # reject blank lines
.grep_v(/^#/) # reject comments
.flat_map { |path| Dir[File.expand_path(path)] }
.map { |path| Shellwords.escape(path) }
.join " "
' < ~/.rubiesrc
))"
}
alias chruby='chruby-reload && chruby '
and my .rubiesrc
looks like this:
# migrating from rbenv
/usr/local/var/rbenv/versions/*
/usr/local/var/versions/ruby/*
from chruby.
Just ran into this myself.
Is still a DIY, or has something been implemented for this?
from chruby.
Related Issues (20)
- Add safe local bin directory to PATH HOT 4
- Filter out rubies that lack a bin/ruby file
- chruby reports exit status 0 under Bash, but still throws a Ruby exception when switching to mruby HOT 1
- `setup.sh` script is broken on WSL2 Ubuntu 20.04 HOT 1
- Integrate with vscode HOT 2
- Won't able to remove chruby from MacOS Shell HOT 5
- Cannot install latest ruby through chruby on Mac M2 Apple Chip HOT 1
- "chruby: unknown Ruby: ruby-3.1.2" was shown everytime launch terminal HOT 4
- Wrong $PATH in Nova Editor process
- Is there a deterministic way of checking whether bundle exec is necessary? HOT 5
- Release 0.4.0
- Chruby puts a missing directory on the PATH HOT 2
- Rename `share/chruby/dev.sh` to `share/chruby/testing.sh` (or other) HOT 7
- chruby not available system-wide HOT 1
- Unable to install on macOS 12.6.7 HOT 2
- yaourt alternative needed HOT 1
- Wiki instructions for Ruby.md - move to 3.3.0 HOT 1
- [Wiki] Incorrect wget path for Ruby install HOT 1
- chruby picking the wrong ruby on substring match HOT 3
- Non-interactive `chruby-exec` fails with `zsh:1: command not found: chruby` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chruby.