zimfw / ruby

Provides ruby, bundler, rbenv and rvm aliases and initialization.
MIT License
0 stars 0 forks source link

command not found: rbenv (even if using rvm) #3

Open rafifos opened 4 years ago

rafifos commented 4 years ago

I did verify the valor of version-management-tool and it's set to rvm.

/Users/rafifos/.zim/modules/ruby/init.zsh:9: command not found: rbenv

rafifos in ~ at A1398
➜ zstyle -L | grep ':zim:ruby'
zstyle :zim:ruby version-management-tool rvm
ericbn commented 4 years ago

@bgrrtt, I think you should either have the configuration with zstyle or test if the tool exists. If there's configuration, it should fail if the respective tool does not exist (by not testing if it exists).

Also, make master the default branch, since zmodule will by default clone and pull from the master branch (no mather what the repo default branch is).

ericbn commented 4 years ago

I prefer avoiding configuration as much as possible, and this is one of the things that make Zim simple in a good way IMO. And if a configuration cannot be avoided, provide a sane default.

In this case I think it would be easier for users if the module automatically initializes whatever tool is installed (by testing of they exist one by one). Not sure what should be the behavior when more than one tool is installed. Initialize then all maybe?

bgrrtt commented 4 years ago

Hey thanks @rafifos! Unfortunately, I had changed the default branch to develop and zim pulls only from master, so you were getting https://github.com/zimfw/ruby/commit/9313206d494c79c212ed524e21aad5efd2f96314, not https://github.com/zimfw/ruby/commit/a8d0d6617f7c8262c9c8bd87599f591bdaea85c2 which added version-management-tool options.

I've since removed version-management-tool options per @ericbn's suggestion in https://github.com/zimfw/ruby/commit/28707ebfc657c440fdbfdfe6a4f902ab5419755d.

@ericbn Having both installed is possible, but doesn't really work as RVM takes over the gem command. As I've tested on macOS, if both are installed, RVM seems to take which precedence too.

rafifos commented 4 years ago

In fact, I used rvm prior to this issue, but now I use rbenv.