Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

install error: tins requires Ruby version >= 2.0 #94

Open
pravdinalex opened this issue Aug 19, 2016 · 14 comments
Open

install error: tins requires Ruby version >= 2.0 #94

pravdinalex opened this issue Aug 19, 2016 · 14 comments

Comments

@pravdinalex
Copy link

pravdinalex commented Aug 19, 2016

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:
#54

@ibc
Copy link
Member

ibc commented Aug 19, 2016

Ruby >= 2.0 required, it's just that.

@ibc ibc closed this as completed Aug 19, 2016
@pravdinalex
Copy link
Author

pravdinalex commented Aug 19, 2016

....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?

@ibc ibc reopened this Aug 19, 2016
@ibc
Copy link
Member

ibc commented Aug 19, 2016

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

@ibc
Copy link
Member

ibc commented Aug 19, 2016

OverSIP 2.0.4 released. Please check it and let me know.

@Worldexe
Copy link

Worldexe commented Aug 19, 2016

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.

@pravdinalex
Copy link
Author

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)

@Worldexe
Copy link

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..

@ibc
Copy link
Member

ibc commented Aug 19, 2016

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.

@Worldexe
Copy link

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.

@Worldexe
Copy link

Worldexe commented Aug 19, 2016

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.

@ibc
Copy link
Member

ibc commented Aug 20, 2016

Ok. So, is there anything the OverSIP deb package can do to avoid this problem?

@Worldexe
Copy link

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:

  1. Depend explicitly on ruby2.0 package (done already?);
  2. Call gem2.0 instead of gem in deb install script;
  3. As /usr/local/bin/oversip explicitly uses ruby2.0 shebang, it would be better to check for ruby2.0 executable in /etc/init.d/oversip script (now it just checks which ruby).

@pravdinalex
Copy link
Author

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

@mathcoder23
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants