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

Support Rubinius gems binstubs location #461

Closed
wants to merge 2 commits into from
Closed

Support Rubinius gems binstubs location #461

wants to merge 2 commits into from

Conversation

mislav
Copy link
Member

@mislav mislav commented Oct 6, 2013

Rubinius 2.0 configures RubyGems to install gem binstubs in PREFIX/gems/bin instead of just PREFIX/bin.

The reason given by evanphx is that Rubinius wants to avoid RubyGems' binstubs conflating with those from other Rubies. http://git.io/XBWGew

Fixes #178
/cc @sstephenson

Rubinius 2.0 configures RubyGems to install gem binstubs in
`PREFIX/gems/bin` instead of just `PREFIX/bin`.

The reason given by evanphx is that Rubinius wants to avoid RubyGems'
binstubs conflating with those from other Rubies. http://git.io/XBWGew

Fixes #178
@dstrelau
Copy link

dstrelau commented Oct 7, 2013

This doesn't seem to work for me. This is rbenv installed via homebrew with this patch applied.

$ echo $RBENV_ROOT
/usr/local/var/rbenv
$ grep 'make_shims ' /usr/local/Cellar/rbenv/HEAD/libexec/rbenv-rehash
make_shims ../versions/*/{,gems/}bin/*
$ ls $RBENV_ROOT/versions/rbx-2.0.0/gems/bin/bundle
/usr/local/var/rbenv/versions/rbx-2.0.0/gems/bin/bundle*
$ rbenv rehash
$ rbenv shell rbx-2.0.0
$ bundle
rbenv: bundle: command not found

I'm not super familiar with rbenv internals or how to debug this. Am I missing something?

@mislav
Copy link
Member Author

mislav commented Oct 7, 2013

@dstrelau Thanks for checking this out. It turns out my brain is broken, as I just solved the Rubinius issue half way and never actually made a change that actually makes the shims work for Rubinius.

I've just pushed an additional commit that should take care of that. Running bundle should work for you now. Thanks for your feedback!

@dstrelau
Copy link

dstrelau commented Oct 7, 2013

Awesome. This is working for me now. Thanks!

@ka8725
Copy link

ka8725 commented Oct 8, 2013

When are you going to make release? Or how can I update rbenv through brew now to get this change?

@mislav
Copy link
Member Author

mislav commented Oct 8, 2013

@ka8725 Not sure if this will make it in the rbenv release. This is just an idea. If you want to use it, maybe @dstrelau can share steps to patching the Homebrew formula

@dstrelau
Copy link

dstrelau commented Oct 8, 2013

@ka8725 I'm using this formula with brew install rbenv --HEAD. This is probably all sorts of wrong, but seems to work for me.

https://gist.github.com/dstrelau/6892770

@ka8725
Copy link

ka8725 commented Oct 9, 2013

It's not suitable to install all ruby versions and their gems after upgrading... If I understand correctly after upgrading rbenv I can just move old rubies to new rbenv version's folder and it should work. Right? Also I applied this patch locally and I can approve that it works. 👍 for merge

@mislav
Copy link
Member Author

mislav commented Oct 9, 2013

@ka8725 If you have Ruby versions installed in different locations on your system and want to make them available in rbenv without re-installing, you can symlink them into rbenv's version directory:

ln -s /opt/rubies/ruby-2.0.0 ~/.rbenv/versions/2.0.0-p0

Don't move them with mv because that might break the Ruby installation.

@sferik
Copy link

sferik commented Oct 15, 2013

@sstephenson Any thoughts on this?

@mislav
Copy link
Member Author

mislav commented Oct 15, 2013

Note that this PR is incomplete: I haven't patched whence yet. However, I'm not liking where this is going. It just burdens rbenv with unnecessary complexity.

I'd rather patch ruby-build instead to symlink gems/bin to point to bin. WDYT?

@sstephenson
Copy link
Contributor

+1 to fixing this in ruby-build instead.

@mislav
Copy link
Member Author

mislav commented Oct 15, 2013

Nuking this with 🔥

@mislav mislav closed this Oct 15, 2013
@mislav mislav deleted the rbx-fix branch October 15, 2013 20:23
mislav added a commit to rbenv/ruby-build that referenced this pull request Oct 20, 2013
Rubinius 2 insists that it installs RubyGems binstubs into
`PREFIX/gems/bin` instead of `PREFIX/bin`.

This creates complexity for rbenv rehash and exec processes, so we
symlink `gems/bin` into `bin` and have RubyGems create binstubs at a
location that is consistent with other Ruby implementations.

See rbenv/rbenv#178, rbenv/rbenv#461
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

Successfully merging this pull request may close these issues.

rehash problem with rubinius master
5 participants