rbenv-default-gems icon indicating copy to clipboard operation
rbenv-default-gems copied to clipboard

Clarify README to indicate that default-gems file needs to be placed in $RBENV_ROOT

Open jsallis opened this issue 11 years ago • 12 comments

The README states that the default-gems file needs to be located at ~/.rbenv/default-gems.

I've created a homebrew package for rbenv-default-gems (pull request here) and when installed via homebrew, the default-gems file has to be placed in $RBENV_ROOT which defaults to /usr/local/opt/rbenv instead of ~/.rbenv.

I'm not sure if $RBENV_ROOT is set when rbenv is installed manually without homebrew

Maybe the README could be clarified to indicate that the default-gems file location is potentially not ~/.rbenv though?

jsallis avatar Feb 02 '13 21:02 jsallis

I was bitten by that problem: https://github.com/mxcl/homebrew/commit/b7f2f88be798ad892432f487dffab79ffe51cb25#commitcomment-2576034

Homebrew does not set $RBENV_ROOT automatically (it's just mentioned in the caveats for rbenv). I'm suspecting rbenv-default-gems uses that environment variable, when the definitive information is given by rbenv root.

cdlm avatar Feb 07 '13 10:02 cdlm

@cdlm Can you try and set RBENV_ROOT and confirm that rbenv-default-gems behaves correctly after that?

MikeMcQuaid avatar Feb 08 '13 03:02 MikeMcQuaid

As a note, here's my environment settings:

$ echo $RBENV_ROOT
/usr/local/opt/rbenv

$ rbenv root
/usr/local/opt/rbenv

jsallis avatar Feb 08 '13 03:02 jsallis

$ rbenv root
/Users/damien/.rbenv
$ echo $RBENV_ROOT
/Users/damien/.rbenv
$ cat $RBENV_ROOT/default-gems
bundler

# ruby development
yard
pry
rake

# general utilities
gem-man
jump
gist
jist
terminal-notifier

# writing
trex
kramdown

$ rbenv install 2.0.0-rc1
Downloading ruby-2.0.0-rc1.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-rc1.tar.gz
Installing ruby-2.0.0-rc1...
Installed ruby-2.0.0-rc1 to /Users/damien/.rbenv/versions/2.0.0-rc1

$ rbenv shell
rbenv: no shell-specific version configured
$ rbenv shell 2.0.0-rc1
$ rbenv shell
2.0.0-rc1
$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
io-console (0.3)
json (1.7.5)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0.preview3.1)
test-unit (2.0.0.0)

cdlm avatar Feb 08 '13 11:02 cdlm

I've tried putting debug statements in default-gems.bash and it looks like it's not even loaded when I rbenv install something… :confused: What did I miss here, is it not supposed to register itself into rbenv ?

cdlm avatar Feb 09 '13 14:02 cdlm

OK, I've removed ~/.rbenv entirely and changed my shell config to have $RBENV_ROOT point to homebrew, and created $RBENV_ROOT/default-gems. Seems to have fixed things.

What threw me off is the wording in brew info rbenv, which suggests setting $RBENV_ROOT is optional even if you intend to use rbenv plugins. Other plugins seemed to work so I supposed it was ok to leave it unset and use ~/.rbenv.

cdlm avatar Feb 09 '13 18:02 cdlm

I should have fixed the wording now but if you have any more suggestions then let me know in the Homebrew issue/commit.

MikeMcQuaid avatar Feb 09 '13 19:02 MikeMcQuaid

What’s the final verdict here please? When installed via/using homebrew should anyone avoid ~/.rbenv?

exalted avatar Mar 15 '13 08:03 exalted

No, it's fine to use ~/.rbenv (and in fact I'm doing that now). You should set RBENV_ROOT either globally or just use ~/.rbenv; Homebrew is happy with either.

MikeMcQuaid avatar Mar 15 '13 10:03 MikeMcQuaid

:thumbsup:

exalted avatar Mar 15 '13 10:03 exalted

… and ~/.rbenv/default-gems works fine too

On 15 March 2013 11:16, Ali Servet Donmez [email protected] wrote:

[image: :thumbsup:]

— Reply to this email directly or view it on GitHubhttps://github.com/sstephenson/rbenv-default-gems/issues/1#issuecomment-14953140 .

Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet

cdlm avatar Mar 15 '13 13:03 cdlm

@cdlm I can’t agree on that...

exalted avatar Mar 15 '13 14:03 exalted