[opensuse-ruby] How to run current versions of ruby on Leap
I tried to find some documentation about what our recommended way of running a recent version of Ruby on Leap is. Leap comes with 2.1 which is not supported by upstream anymore. There are more recent versions available in the build service, but they don't install as `ruby`, so most tooling doesn't work out of the box. I couldn't find any documentation about how this is supposed to be done on Leap. Most people actually seem to use and recommend rvm, which comes with its own challenges. What is our stance on this? Are there any pointers? -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Tue, 27 Jun 2017 16:13:48 +0200 Cornelius Schumacher <cschum@suse.de> wrote:
I tried to find some documentation about what our recommended way of running a recent version of Ruby on Leap is. Leap comes with 2.1 which is not supported by upstream anymore. There are more recent versions available in the build service, but they don't install as `ruby`, so most tooling doesn't work out of the box. I couldn't find any documentation about how this is supposed to be done on Leap.
Most people actually seem to use and recommend rvm, which comes with its own challenges.
What is our stance on this? Are there any pointers?
well, my suggestion do not try to change your system ruby to newer one, otherwise YaST start failing misserably, as it is built against system one. So I really suggest rvm or rbenv. I see that someone try update-alternatives, but then YaST failing. ( it works with rvm or rbenv as yast explicitelly unset its ENV to force it to use system ruby ) Josef -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Hey, On 27.06.2017 16:13, Cornelius Schumacher wrote:
What is our stance on this? Are there any pointers?
Install the packaged version you want. Handle ruby by linking it into a directory that is in front of your path. ln -sf /usr/bin/ruby.ruby$VERSION ~/bin/ruby ln -sf /usr/bin/gem.ruby$VERSION ~/bin/gem Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Wed, 28 Jun 2017 13:38:59 +0200 Henne Vogelsang <hvogel@opensuse.org> wrote:
Hey,
On 27.06.2017 16:13, Cornelius Schumacher wrote:
What is our stance on this? Are there any pointers?
Install the packaged version you want. Handle ruby by linking it into a directory that is in front of your path.
ln -sf /usr/bin/ruby.ruby$VERSION ~/bin/ruby ln -sf /usr/bin/gem.ruby$VERSION ~/bin/gem
as the ruby maintainer i can recommend this way if you can't live with versioned binaries. As Josef pointed out already do not change the system ruby. Now if we as openSUSE project would want to have /usr/bin/ruby variable the following things need to be done: 1. fix all shebang lines to use a version ruby path. 2. make sure all packages require the version used in their shebang line. 3. switch code to update-alternatives for /usr/bin/ruby. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Hey, On 28.06.2017 14:58, Marcus Rückert wrote:
the following things need to be done:
One rainy day, not unlike this one, .... Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On 2017 M06 28, Wed 14:58:33 CEST Marcus Rückert wrote:
as the ruby maintainer i can recommend this way if you can't live with versioned binaries.
The problem with versioned binaries is that it's incovenient to type, and more importantly that all documentation, examples, snippets, scripts you can find out there are assuming non-versioned binaries. It would be nicer to have a way to work with Ruby which works out of the box for everybody.
As Josef pointed out already do not change the system ruby.
Might it be possible to make YaST use a versioned version of Ruby, so that the system Ruby would be a bit more flexible? -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Wed, 28 Jun 2017 16:01:47 +0200 Cornelius Schumacher <cschum@suse.de> wrote:
On 2017 M06 28, Wed 14:58:33 CEST Marcus Rückert wrote:
as the ruby maintainer i can recommend this way if you can't live with versioned binaries.
The problem with versioned binaries is that it's incovenient to type, and more importantly that all documentation, examples, snippets, scripts you can find out there are assuming non-versioned binaries. It would be nicer to have a way to work with Ruby which works out of the box for everybody.
I really hope that having to call a binary with a slightly different name is something that the average developer can do. And as i said this only affects a few very core binaries. all our rubygem rpms are using update-alternatives.
As Josef pointed out already do not change the system ruby.
Might it be possible to make YaST use a versioned version of Ruby, so that the system Ruby would be a bit more flexible?
Sure. Will you and your team help with the work and the maintenance to keep it working in the long run? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On 2017 M06 28, Wed 17:15:10 CEST Marcus Rückert wrote:
I really hope that having to call a binary with a slightly different name is something that the average developer can do.
Developers certainly can do that once they noticed that they have to. It still is annoying when you have to type more than necessary and if you have to change instructions and scripts you find elsewhere. I understand the versioning from a packaging perspective, but from a user's perspective it doesn't provide the best experience. I would prefer if we had a great out-of-the-box experience for Ruby on openSUSE which follows the conventions everybody else is using.
And as i said this only affects a few very core binaries. all our rubygem rpms are using update-alternatives.
Which doesn't feel to be very consistent.
As Josef pointed out already do not change the system ruby.
Might it be possible to make YaST use a versioned version of Ruby, so that the system Ruby would be a bit more flexible?
Sure. Will you and your team help with the work and the maintenance to keep it working in the long run?
If YaST would rely on the specific version it is tested with and not use the default "ruby" executable it would not change the maintenance effort, would it? Wouldn't this even make things easier as there are more specific dependencies and less chance of breakage through unrelated changes in the system? -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Sat, 2017-07-01 at 23:53 +0200, Cornelius Schumacher wrote:
On 2017 M06 28, Wed 17:15:10 CEST Marcus Rückert wrote:
I really hope that having to call a binary with a slightly different name is something that the average developer can do.
Developers certainly can do that once they noticed that they have to. It still is annoying when you have to type more than necessary and if you have to change instructions and scripts you find elsewhere.
http://blog.koehntopp.info/index.php/2022-leveraging-flawed-tutorials-f or-seeding-large-scale-web-vulnerability-discovery/
I understand the versioning from a packaging perspective, but from a user's perspective it doesn't provide the best experience. I would prefer if we had a great out-of-the-box experience for Ruby on openSUSE which follows the conventions everybody else is using.
yes. everybody else supports just one ruby version or does a lot of mangling of shell variables to make it work otherwise. I prefer a solution where i can call all rubies all the time.
And as i said this only affects a few very core binaries. all our rubygem rpms are using update-alternatives.
Which doesn't feel to be very consistent.
Well unless we make the effort to handle the she bang lines in all ruby scripts we have no other choices than locking down a few binaries.
As Josef pointed out already do not change the system ruby.
Might it be possible to make YaST use a versioned version of Ruby, so that the system Ruby would be a bit more flexible?
Sure. Will you and your team help with the work and the maintenance to keep it working in the long run?
If YaST would rely on the specific version it is tested with and not use the default "ruby" executable it would not change the maintenance effort, would it? Wouldn't this even make things easier as there are more specific dependencies and less chance of breakage through unrelated changes in the system?
no the story is differently: we only tested and verified yast with the default ruby. over time more rubies got added, but given that we can not put in the effort to make sure that yast and co work on all ruby versions at the same time, we need to lock down she bang lines. which we dont do right now. gems do that automatically. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Montag, 3. Juli 2017 14:54:31 CEST Marcus 'darix' Rückert wrote:
yes. everybody else supports just one ruby version or does a lot of mangling of shell variables to make it work otherwise. I prefer a solution where i can call all rubies all the time.
From what I can tell most Ruby users are not using distribution packages at all, because of all the hassle and limitations which come with them. -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Cornelius Schumacher writes:
On Montag, 3. Juli 2017 14:54:31 CEST Marcus 'darix' Rückert wrote:
yes. everybody else supports just one ruby version or does a lot of mangling of shell variables to make it work otherwise. I prefer a solution where i can call all rubies all the time.
From what I can tell most Ruby users are not using distribution packages at all, because of all the hassle and limitations which come with them.
I am one of those. But basically I don't care about using the distribution ruby if I can a) create my gem environments b) have a recent ruby available otherwise, rbenv install $version just becomes a way for me to install gems as a user. -- Duncan Mac-Vicar P. - Director, Data Center Management; R&D SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On 2017 M06 28, Wed 13:38:59 CEST Henne Vogelsang wrote:
Hey,
On 27.06.2017 16:13, Cornelius Schumacher wrote:
What is our stance on this? Are there any pointers?
Install the packaged version you want. Handle ruby by linking it into a directory that is in front of your path.
ln -sf /usr/bin/ruby.ruby$VERSION ~/bin/ruby ln -sf /usr/bin/gem.ruby$VERSION ~/bin/gem
This has to be done for every executable which is installed by a gem. Is there some more convenient way than doing that manually? -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Wed, 28 Jun 2017 16:29:17 +0200 Cornelius Schumacher <cschum@suse.de> wrote:
On 2017 M06 28, Wed 13:38:59 CEST Henne Vogelsang wrote:
Hey,
On 27.06.2017 16:13, Cornelius Schumacher wrote:
What is our stance on this? Are there any pointers?
Install the packaged version you want. Handle ruby by linking it into a directory that is in front of your path.
ln -sf /usr/bin/ruby.ruby$VERSION ~/bin/ruby ln -sf /usr/bin/gem.ruby$VERSION ~/bin/gem
This has to be done for every executable which is installed by a gem. Is there some more convenient way than doing that manually?
actually all our rubygems rpms are using update-alternative. just a few core binaries are not. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Wed, 28 Jun 2017 17:12:58 +0200 Marcus Rückert <darix@opensu.se> wrote:
actually all our rubygems rpms are using update-alternative. just a few core binaries are not.
which btw adds its own extra fun: $ zypper in ruby2.4-rubygem-somelib $ pry [1] pry(main)> require 'somelib' LoadError: cannot load such file -- somelib and then you find out your pry is still configured to ruby 2.3 that's why i for most of the time actually use the version thing. So i can always be sure that i have the version I want. -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Hey, On 28.06.2017 16:29, Cornelius Schumacher wrote:
On 2017 M06 28, Wed 13:38:59 CEST Henne Vogelsang wrote:
On 27.06.2017 16:13, Cornelius Schumacher wrote:
What is our stance on this? Are there any pointers?
Install the packaged version you want. Handle ruby by linking it into a directory that is in front of your path.
ln -sf /usr/bin/ruby.ruby$VERSION ~/bin/ruby ln -sf /usr/bin/gem.ruby$VERSION ~/bin/gem
This has to be done for every executable which is installed by a gem.
Not if you use install: --no-format-executable in your gemrc. I usually throw export GEM_HOME=~/.gems into the mix too. It gives you a nice separation to the system stuff. HTH :-) Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On 2017 M06 28, Wed 18:35:04 CEST Henne Vogelsang wrote:
Not if you use
install: --no-format-executable
in your gemrc.
I usually throw
export GEM_HOME=~/.gems
into the mix too. It gives you a nice separation to the system stuff.
Yes, in this combination and when you add $GEM_HOME/bin to your path it makes sense. It also gives an easy and safe way to uninstall all gems by just removing the directory. Switching between different Ruby versions needs a versioned GEM_HOME, though. That's not difficult to set up, if you need it. Or you just remove the directory and start from scratch when switching to another Ruby version. And you do need to add the symbolic links for the other executables which come with ruby, in particular irb, which is something you might type quite often.
HTH :-)
It does. Thanks a lot. It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience. -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Cornelius Schumacher writes:
Yes, in this combination and when you add $GEM_HOME/bin to your path it makes sense. It also gives an easy and safe way to uninstall all gems by just removing the directory.
Switching between different Ruby versions needs a versioned GEM_HOME, though. That's not difficult to set up, if you need it. Or you just remove the directory and start from scratch when switching to another Ruby version.
And you do need to add the symbolic links for the other executables which come with ruby, in particular irb, which is something you might type quite often.
I used to use rbenv a lot and I loved it except for the fact that I needed to compile my own ruby in order to take advantage of a gem sandbox. It would be nice if rbenv could see all system rubies and the gems associated to it. That plus something like https://github.com/mislav/rbenv-user-gems to overlay your own gems. -- Duncan Mac-Vicar P. - Director, Data Center Management; R&D SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Hey, On 01.07.2017 23:45, Cornelius Schumacher wrote:
It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience.
How about we write orr (openSUSE rvm replacement) that helps you switch between versions. Sounds like fun, next Hack Week... Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Henne Vogelsang writes:
Hey,
On 01.07.2017 23:45, Cornelius Schumacher wrote:
It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience.
How about we write orr (openSUSE rvm replacement) that helps you switch between versions. Sounds like fun, next Hack Week...
I'd be surprised if rbenv can't be extended to do something like this. Why not start with rbenv? - extend it to recognize multiple system rubies - set $RBENV_ROOT to a read-only system-path (currently setting version writes to $RBENV_ROOT/version) - have the ruby rpms install to ${RBENV_ROOT}/versions Probably requires to add a "layered" approach to rbenv, so that instead of a single RBENV_ROOT, it starts with $HOME/.rbenv/ and then falls back to a system wide $RBENV_ROOT. -- Duncan Mac-Vicar P. - Director, Data Center Management; R&D SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Montag, 3. Juli 2017 18:01:22 CEST Henne Vogelsang wrote:
On 01.07.2017 23:45, Cornelius Schumacher wrote:
It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience.
How about we write orr (openSUSE rvm replacement) that helps you switch between versions. Sounds like fun, next Hack Week...
That was my thought as well. Something which is specific to SUSE so it can be kept simple. Something which is targeted at end users wanting to use Ruby, so it can focus on what makes the experience nice and simple and doesn't have to deal with all the corner cases and implementation details of packaging. -- Cornelius Schumacher <cschum@suse.de> -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Hey, On 04.07.2017 13:23, Cornelius Schumacher wrote:
On Montag, 3. Juli 2017 18:01:22 CEST Henne Vogelsang wrote:
On 01.07.2017 23:45, Cornelius Schumacher wrote:
It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience.
How about we write orr (openSUSE rvm replacement) that helps you switch between versions. Sounds like fun, next Hack Week...
That was my thought as well.
Started to pull it up -> https://github.com/hennevogel/orr No functionality yet but I keep at it, contribute if you can :-) Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Henne Vogelsang writes:
Hey,
On 04.07.2017 13:23, Cornelius Schumacher wrote:
On Montag, 3. Juli 2017 18:01:22 CEST Henne Vogelsang wrote:
On 01.07.2017 23:45, Cornelius Schumacher wrote:
It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience.
How about we write orr (openSUSE rvm replacement) that helps you switch between versions. Sounds like fun, next Hack Week...
That was my thought as well.
Started to pull it up -> https://github.com/hennevogel/orr
No functionality yet but I keep at it, contribute if you can :-)
so rbenv is not an option to be extended? -- Duncan Mac-Vicar P. - Director, Data Center Management; R&D SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Hey, On 05.07.2017 17:54, Duncan Mac-Vicar P. wrote:
Henne Vogelsang writes:
On 04.07.2017 13:23, Cornelius Schumacher wrote:
On Montag, 3. Juli 2017 18:01:22 CEST Henne Vogelsang wrote:
On 01.07.2017 23:45, Cornelius Schumacher wrote:
It would be great, if we would have a nicer Ruby experience out of the box, but I like the setup you described. This results in a nice experience.
How about we write orr (openSUSE rvm replacement) that helps you switch between versions. Sounds like fun, next Hack Week...
That was my thought as well.
Started to pull it up -> https://github.com/hennevogel/orr
No functionality yet but I keep at it, contribute if you can :-)
so rbenv is not an option to be extended?
Sure it is, but I rather concentrate on something simple for openSUSE for now. I really don't want to mess around with multiple distributions in rbenv in my spare time, sorry 🙃 Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
Henne Vogelsang writes:
Sure it is, but I rather concentrate on something simple for openSUSE for now. I really don't want to mess around with multiple distributions in rbenv in my spare time, sorry 🙃
Sure, go ahead... in case someone is looking for a different approach. I really think taking rbenv and (from https://github.com/rbenv/rbenv/tree/master/libexec) - replacing rbenv-versions with an impl that lists installed ruby's - replacing rbenv-install with some zypper search + install sauce ... gives the social benefit of being a popular/familiar tool with the openSUSE way of packaging... -- Duncan Mac-Vicar P. - Director, Data Center Management; R&D SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
participants (6)
-
Cornelius Schumacher
-
Duncan Mac-Vicar P.
-
Henne Vogelsang
-
Josef Reidinger
-
Marcus 'darix' Rückert
-
Marcus Rückert