Most ruby packages are not maintained by the Archlinux repository, I installed them locally then added ~/.gem/ruby/2.1.0/bin
to $PATH
.
Although the ruby version is 2.1.5
, it uses 2.1.0
as the library version. It feels silly if I change it manually every time, so I have to find a way to check it automatically.
Refer to this post, the output of ruby -e 'puts $LOAD_PATH'
includes what I need.
|
|
Then use sed
and grep
to find it out.
|
|
Finally I added the following line to .zshrc
and it works fine.
|
|
BTW, this script can also be used in the PKGBUILD of ruby gem packages.