Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jsallis opened this issue Feb 2, 2013 · 12 comments

Comments

@jsallis
Copy link

jsallis commented Feb 2, 2013

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?

@cdlm
Copy link

cdlm commented Feb 7, 2013

I was bitten by that problem: Homebrew/legacy-homebrew@b7f2f88#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.

@MikeMcQuaid
Copy link

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

@jsallis
Copy link
Author

jsallis commented Feb 8, 2013

As a note, here's my environment settings:

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

$ rbenv root
/usr/local/opt/rbenv

@cdlm
Copy link

cdlm commented Feb 8, 2013

$ 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
Copy link

cdlm commented Feb 9, 2013

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

@cdlm
Copy link

cdlm commented Feb 9, 2013

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.

@MikeMcQuaid
Copy link

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

@exalted
Copy link

exalted commented Mar 15, 2013

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

@MikeMcQuaid
Copy link

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.

@exalted
Copy link

exalted commented Mar 15, 2013

👍

@cdlm
Copy link

cdlm commented Mar 15, 2013

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

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

[image: 👍]


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

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

@exalted
Copy link

exalted commented Mar 15, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants