Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

ruby - Openshift and net-ssh incompatibility? (2.9.3-beta1 vs 2.9.2)

by searching to access my Postgres DB on Openshift, i'm currently facing problem using net-ssh.

  • At this step - note that the installed Ruby version is 2.2.0 and net-ssh is 2.9.3-beta1

To be able to access the DB from my local DB IDE, i need to execute: rhc port-forward myappname

But the execution returns this error: Checking available ports ... Could not parse PKey: no start line

As you can see in this post (an other ones e.g. this one), the fix is to back to a stable version of net-ssh. the 2.9.2. What i've succesfully done.

But now, running rhc port-forward myappname is giving me the following error: .../2.2.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file

And the fix is to upgrade net-ssh to the 2.9.3-Beta1 version (see this post).

This is really weird! Seems that "the snake is biting its own tail" (don't know if that french expression got english translation).

Note that i've tried to make a clean setup with new ssh key gen (automatically and manually). My system is runnin' Win 7 64bits.

I made uninstall/install of last version of Ruby. Reinstall of rhc. Last version running on rhc-1.36.4. The problem goes on.

Can you help? Should i install an older version of ssh-net and/or Ruby (i'm not allowed to use ssh-net 2.5.2 due to new version of rhc)?

(sorry for my bad english)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

rhc/Gemfile & rhc/rhc.gemspec required gem "net-ssh", "<= 2.9.2" net-ssh version 2.9.2 use require dl/import atleast on pageant.rb

dl/import is removed from ruby see https://github.com/ruby/ruby/blob/v2_2_0/NEWS#L148-L149 instead fiddle is recommended

net-ssh 3.* seems to fix this(uses fiddle/{import,{ for ruby >= 2.1)
net-ssh version 3.
seems to have drop in compatibility(still working on mine) for rhc

So a simple hack is to modify rhc/Gemfile & rhc/rhc.gemspec and install the gem
A guy already have done it.

A Solution(Untested)

gem 'rhc', :git => 'git://github.com/thrasher-redhat/rhc.git'

from https://stackoverflow.com/a/7421712/2382629

Alternative Solution(Tested even on windows 7 32bit :p)

git clone https://github.com/openshift/rhc
cd rhc

modify rhc/Gemfile & rhc/rhc.gemspec like https://github.com/openshift/rhc/pull/748/files then

gem build rhc.gemspec

it should output like

blah! blah! blah! warnings and msgs......
Successfully built RubyGem
Name: rhc
Version: 1.38.4
File: rhc-1.38.4.gem

then run

gem install rhc-1.38.4.gem

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...