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

/usr/bin integration #6

Open
FooBarWidget opened this issue Jun 20, 2019 · 5 comments
Open

/usr/bin integration #6

FooBarWidget opened this issue Jun 20, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@FooBarWidget
Copy link
Member

Rubies are now installed into their own directories that are not in PATH. This safe, but it's not very user-friendly, especially not for users who only intend to install 1 Ruby version on their system.

We should have some kind of way to provide /usr/bin/{ruby,gem,bundle,irb}. This will conflict with the system Ruby package, but c'est la vie.

On Debian/Ubuntu, we should integrate with the alternatives system.

How would this work? A proposal

We provide an optional fullstaq-ruby-system-integration package. This package contains the scripts /usr/lib/fullstaq-ruby/system-integration/bin/{ruby,gem,bundle,irb}.

These scripts simply call /usr/bin/rbenv exec ruby|gem|bundle|irb.

This package integrates with the alternatives system to ensure that /usr/bin/{ruby,gem,bundle,irb} are symlinked to the corresponding script in /usr/lib/fullstaq-ruby/system-integration/bin.

@FooBarWidget FooBarWidget added this to the General availability milestone Jun 20, 2019
@FooBarWidget FooBarWidget added the enhancement New feature or request label Jun 20, 2019
@jrochkind
Copy link

I was coming to look for this -- if this means no need to run rbenv or any other version switcher? You could effectively install as the default system ruby? I am very interested in that feature!

@FooBarWidget
Copy link
Member Author

Correct, that's exactly what this is supposed to be.

@jrochkind
Copy link

jrochkind commented Sep 3, 2019

Ah, but reading more closely, rbenv is still there, you just don't need to know about it. "These scripts simply call /usr/bin/rbenv exec {ruby|gem|bundle|irb}".

Hmm, if that's really all they do... this is a pretty trivial implementation, I could try it out myself by just writing those four scripts myself? (I still kind of wish there was no rbenv involved at all, but i'm not sure how rational this is).

@FooBarWidget
Copy link
Member Author

Yes it should be pretty trivial (though integration with the Debian alternatives system needs to be figured out, and documentation needs to be written for it). And contributions are always welcome.

@p8
Copy link

p8 commented May 23, 2022

I'm using update-alternatives on Ubuntu. No need for rbenv.

# install ruby 3.0
RUN apt-get update -q \
    && apt-get dist-upgrade --assume-yes \
    && apt-get install --assume-yes -q --no-install-recommends \
      curl \
      gnupg \
      apt-transport-https \
      ca-certificates

RUN curl -SLf https://raw.githubusercontent.com/fullstaq-labs/fullstaq-ruby-server-edition/main/fullstaq-ruby.asc | apt-key add - \
    && echo "deb https://apt.fullstaqruby.org ubuntu-20.04 main" > /etc/apt/sources.list.d/fullstaq-ruby.list \
    && apt-get update -q \
    && apt-get install --assume-yes -q --no-install-recommends fullstaq-ruby-3.0 \
    && apt-get autoremove --assume-yes \
    && rm -rf /var/lib/apt/lists \
    && rm -fr /var/cache/apt \
    && rm /etc/apt/sources.list.d/fullstaq-ruby.list

RUN update-alternatives --install /usr/local/bin/bundle  bundle  /usr/lib/fullstaq-ruby/versions/3.0/bin/bundle  100
RUN update-alternatives --install /usr/local/bin/bundler bundler /usr/lib/fullstaq-ruby/versions/3.0/bin/bundler 100
RUN update-alternatives --install /usr/local/bin/gem     gem     /usr/lib/fullstaq-ruby/versions/3.0/bin/gem     100
RUN update-alternatives --install /usr/local/bin/irb     irb     /usr/lib/fullstaq-ruby/versions/3.0/bin/irb     100
RUN update-alternatives --install /usr/local/bin/ruby    ruby    /usr/lib/fullstaq-ruby/versions/3.0/bin/ruby    100

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

No branches or pull requests

3 participants