install error: tins requires Ruby version >= 2.0
Ubuntu 14.04 amd64, no ruby preinstalled or installed ruby 2.3.1 (in both situations) Can't install oversip:
...# apt-get install oversip ... installing 'oversip' Ruby Gem version 2.0.3... ERROR: Error installing oversip: tins requires Ruby version >= 2.0.
(got ruby 1.9.1 installed after that)
Is RVM workaround the only way?
Similar closed dependency issue: https://github.com/versatica/OverSIP/issues/54
Ruby >= 2.0 required, it's just that.
....but OverSip installs ruby 1.9.1 forced, not me... If Ruby 2.3.1 is preinstalled before OverSip, installation of OverSip removes it and install 1.9.1. What exactly should I do to avoid this error?
Sorry, my fault. I don't understand, oversip just requires Ruby >= 1.9.2.
It seems that such a tins dependency is a dependency of term-ansicolor (which is a real dependency of oversip). May you check which version(s) of term-ansicolor do you have installed?:
$ gem list | grep ansicolor
OverSIP 2.0.4 released. Please check it and let me know.
I have the same problem, just tried out 2.0.4 - didnt work.
# apt-get install oversip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
unbound
The following NEW packages will be installed:
oversip
0 upgraded, 1 newly installed, 0 to remove and 289 not upgraded.
Need to get 0 B/147 kB of archives.
After this operation, 349 kB of additional disk space will be used.
(Reading database ... 78341 files and directories currently installed.)
Preparing to unpack .../archives/oversip_2.0.4_all.deb ...
installing 'oversip' Ruby Gem version 2.0.4...
ERROR: Error installing oversip:
tins requires Ruby version >= 2.0.
dpkg: error processing archive /var/cache/apt/archives/oversip_2.0.4_all.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
# ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
# ruby2.0 --version
ruby 2.0.0p384 (2014-01-12) [x86_64-linux-gnu]
It seems I can not just set ruby2.0 as default ruby version in 14.04. update-alternatives does not know about ruby.
Neither 1.9 nor 2.0 version has term-ansicolor installed.
Yes, error remains:
installing 'oversip' Ruby Gem version 2.0.4... ERROR: Error installing oversip: tins requires Ruby version >= 2.0.
$ gem list | grep ansicolor (after error) -> empty
...# gem list *** LOCAL GEMS *** em-udns (0.3.6) escape_utils (1.0.1) eventmachine-le (1.1.7) iobuffer (1.1.2)
Hmm, forcing ruby2.0 as default version via # update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby2.0 does not help - oversip still whines about tins requires Ruby version >= 2.0..
Honestly no idea. You may try to create a Ruby file with this content:
# Ruby external gems.
require "syslog"
# Load EventMachine-LE here to avoid som EM based gem in server.rb to be loaded first
# (and load eventmachine instead of eventmachine-le).
gem "eventmachine-le", "= 1.1.7"
require "eventmachine-le"
gem "iobuffer", "= 1.1.2"
require "iobuffer"
gem "em-udns", "= 0.3.6"
require "em-udns"
gem "escape_utils", "= 1.0.1"
require "escape_utils"
gem "term-ansicolor", "= 1.3.0"
require "term/ansicolor"
gem "posix-spawn", "= 0.3.9"
require "posix-spawn"
gem "em-synchrony", "= 1.0.3"
require "em-synchrony"
Run it and let's see what happens. You may also try by loading such a tins gem.
I had to set up all the gems it required; the file runs without errors.
But, installing oversip still stops with tins requires Ruby version >= 2.0, although I have already installed tins gem for ruby2.0.
It seems oversip still runs 1.9 version somehow, for which tins gem can not be installed.
Okay, I figured it out.
gem command also must be updated to point to 2.0 version by running
# update-alternatives --install /usr/bin/gem gem /usr/bin/gem2.0 1
Without this, install script inside deb package runs gem install ... which actually runs ruby 1.9.
Ok. So, is there anything the OverSIP deb package can do to avoid this problem?
I believe this is debian/ubuntu 14.04 issue and it will not be fixed in any way (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737782). I suggest following:
- Depend explicitly on
ruby2.0package (done already?); - Call
gem2.0instead ofgemin deb install script; - As
/usr/local/bin/oversipexplicitly usesruby2.0shebang, it would be better to check forruby2.0executable in/etc/init.d/oversipscript (now it just checkswhich ruby).
I managed to install oversip 2.0.4 on Ubuntu 14.04 after:
apt-get install ruby2.0
apt-get install ruby2.0-dev
update-alternatives --install /usr/bin/gem gem /usr/bin/gem2.0 1
install failed. emergency solution 1,ruby -v .if version <2.0.0,install ruby >2.0.0 2,rm /usr/bin/ruby ,and ln -s /usr/bin/ruby2.0.0 /usr/bin/ruby 3,gem install oversip