basilmir
Posts: 7
Joined: Fri Mar 20, 2015 4:32 pm

Raspbian has Ruby 1.9.3 already installed, why? Why so old?

Sat Mar 21, 2015 11:05 am

I'm trying out a Ruby gem, and it took a lot of work to get up and running on Raspbian. It seems Ruby 1.9.3 was present, tried:

"apt-get remove ruby1.9.3" only to find out the actual package name is ruby1.9.1 and it got updated. Searching a little deeper reveals a lot of packages if not all, are outdated.

Why is it there? I mean, It can very well continue to be listed in the repositories, but I was thinking it would be best not to include it in the initial installation.

PS. Apparently the Ruby community even has a quote on this:
"Under no circumstance should you install Ruby, Rubygems or any Ruby-related packages from apt-get. This system is out-dated and leads to major headaches. Avoid it for Ruby-related packages. We do Ruby, we know what's best. Trust us."
Oh yeah?! What if it comes preinstalled?

Later edit:
I just "sudo apt-get remove ruby1.9.1" and it seems sonic-pi was using it.

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Sat Mar 21, 2015 11:13 am

In general the whole point of a stable release of a linux distro is to provide a stable base. That means keeping changes to a minimum because every change brings with it a risk of breaking stuff.

ruby upstream don't seem to get this and as-such have a very poor relationship with the distros :(

basilmir
Posts: 7
Joined: Fri Mar 20, 2015 4:32 pm

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Sun Mar 22, 2015 11:26 am

Oh thank you! Believe it or not, it was the packages that saved me. Used RVM (which apparently has fallen from grace) and then RBENV to install Ruby and this app that I ran just fine a couple of months ago.

Wasted about 6 hours installing every version from 1.9.3-p551, 2.1.5 and the 'current stable' 2.2.1 only to find that at least one of the gems my app depends on has issues compiling on one of these versions.

Ended up using Raspbian bundling 1.9.3-p227 under the name the package name ruby1.9.1 and just installing the corresponding dev package ruby1.9.1-dev. Then 'sudo gem install wagn' to install the app and it worked. It was a dependency nightmare.

Can't say I feel really good about installing packages that bundle a year old version, but it's better than walking in the dark, can't argue with "it just works" can I.

Thanks!
Last edited by basilmir on Sun Mar 22, 2015 10:04 pm, edited 1 time in total.

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Sun Mar 22, 2015 11:32 am

Stability through freezing isn't a perfect solution. That is only used and wanted by people that use Centos/RHEL/SLED. Developers, average users etc. want to have in general modern software. Ubuntu family does freeze packages but they have fast, 6 month development cycle and they provide newer versions of common software like browsers, while other stuff can be updated by using PPA if needed...

Developers can also use docker. If you need to run something on a newer Ruby, Python, whatever then use a docker image with given interpreter (but Raspberry may not be the optimal at using Docker images ;)).

User avatar
scruss
Posts: 3218
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Sun Mar 22, 2015 12:57 pm

Does Ruby have the equivalent of Perl's perlbrew, or Python's virtualenv? These allow you to run up-to-date development versions of the language without breaking the distro version. This is a good thing.

A quick search turned up Ruby Version Manager (RVM).

Update: Ah, I see you mentioned RVM upthread. So if your development overlay management system is deprecated, how does one ever write anything in Ruby? Maybe that's what made _why leave the community: too much feature-churn.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

basilmir
Posts: 7
Joined: Fri Mar 20, 2015 4:32 pm

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Sun Mar 22, 2015 10:16 pm

Yes, RVM was my tool of choice but apparently the community has switched to RBENV, which actually does what you need. You can run different Ruby versions with a fine granularity (folder, subfolder, etc...) like the name says RBENV is an "environment" the actual ruby installer is a module of that and is installed separately.

RVM had trouble actually installing some versions of Ruby on my Pi 2. Can't really say what was wrong, I never spent any time diagnosing it and just switched. I found RBENV to be more modular and a little more complicated to install, but it gives you more control over everything, can't really say it helped me very much since I just failed to get everything working on that occasion too.

Finally I gave up just installed a clean Raspbian and used the packages:

sudo apt-get netatalk - for mDNS and file sharing so I can contact my Pi on raspberrypi.local, if you only need mDNS then just install sudo apt-get avahi, I don't see why this is not included in Raspbian by default, no point in having a hostname if you can't use it to find your Pi on the local network.

sudo apt-get update - update the repository list.
sudo apt-get upgrade - see if there are any newer versions for packages you already have.

sudo apt-get ruby1.9.1-dev - actually install Ruby 1.9.3-p227-dev the actual name of the package stayed the same while the contents were updated. You need it to compile stuff, especially on the Pi 2 where there are no prebuilt packages available.

sudo gem install passenger - get Passenger (link between Ruby apps and Nginx) installed.
* you also might need sudo apt-get install libcurl4-gnutls-dev - a dependency needed for the next step, it will warn you and ask for you to install it anyway if you forget about it.
sudo passenger-install-nginx-module - compile and install Nginx with the Passenger module.

sudo gem install your_app_of_choice - your app should compile and install it's own dependencies, follow on-screen instructions if it fails.

Done! It works!

richrarobi
Posts: 271
Joined: Sun Feb 08, 2015 1:13 pm

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Thu Mar 26, 2015 9:41 am

As maintenance support has ended for 1.9.3, I wonder if there is an approved or standard way to upgrade to 2.2.1? Or, any plans?

[urlhttps://www.ruby-lang.org/en/news/2015/02/23/su ... has-ended/][/url]

I really appreciate the ease of installation of most packages on raspbian, and the work that must be behind all this, so is there any way the community can help in this matter? Ruby has become an important part of the computing environment and has features not always seen elsewhere. While I could not yet call myself an experienced rubyist, I am sure most would prefer to work with the latest version?

RichR
p.s. I tried the script (detailed in a previous post) to install ruby 2.2.0 (modded to install 2.2.1) - NBB that it installs the ruby version as the user running the script - not ideal - I also tried with sudo - bad move - had to use find to locate it and physically remove it from the /root directory structure (it had installed it for the root user). Aaargh! - re-installing 1.9.1(3) and waiting for official release
p.p.s It does seem that it is linux/ wheezy (or more likely jessie) that is the delay, from a search for wheezy ruby...

mst66186
Posts: 2
Joined: Sun Mar 15, 2015 10:39 am
Location: Melbourne, Australia

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Tue Mar 22, 2016 5:06 am

Me too! I was trying to install a gem:
  • error installing zendesk-api i18n requires Ruby version >= 1.9.3
or
  • error installing zendesk_api mime-types requires Ruby version >= 1.9.2
but
  • $ ruby -v
    ruby 2.1.5p273 (2014-11-13) [arm-linux-gnueabihf]
I eventually hit upon the idea of using
  • whereis ruby
which led me to this page!
Top marks to you, richrarobi, for
  • sudo apt-get remove ruby1.9.1
To those who come after me... Quite a few packages were removed when I dumped ruby1.8. It seems to be OK so far though. I have only just done this and am about to reboot. If I could go back in time I would make a full backup first.
Now I'm going to see if I need whether I have trashed my installation and need to re-install Debian! See you on the other side...

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Raspbian has Ruby 1.9.3 already installed, why? Why so o

Tue Mar 22, 2016 6:34 am

mst66186 wrote:Me too! I was trying to install a gem:
  • error installing zendesk-api i18n requires Ruby version >= 1.9.3
or
  • error installing zendesk_api mime-types requires Ruby version >= 1.9.2
but
  • $ ruby -v
    ruby 2.1.5p273 (2014-11-13) [arm-linux-gnueabihf]
I eventually hit upon the idea of using
  • whereis ruby
which led me to this page!
Top marks to you, richrarobi, for
  • sudo apt-get remove ruby1.9.1
To those who come after me... Quite a few packages were removed when I dumped ruby1.8. It seems to be OK so far though. I have only just done this and am about to reboot. If I could go back in time I would make a full backup first.
Now I'm going to see if I need whether I have trashed my installation and need to re-install Debian! See you on the other side...
You are replying to an out of date Raspbian Wheezy EOL Post :?

Raspbian Jessie, which is the Stable Raspbian release has Ruby 2.1: https://packages.debian.org/jessie/ruby :D
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

Return to “Raspberry Pi OS”