Ruby gem and deb package

When i upgraded 4.10.2 to 5.0.2 on ubuntu 14.04 I was faced with the following problem:
opennebula installs in dependencies ruby gem deb packages. I have runned install_gems script, but then i start, for example, one-flow server - it says: “treetop gem version must be >= 1.6.3. Current version is 1.4.14”. In ‘gem list’ treetop has version 1.6.8, but deb package has 1.4.14. However, i can’t uninstall package, cause it installed by dependencies.
How to resolve this?

You can install more that one gem version. Can you run sudo gem install treetop -v 1.5.3?

Sure, but if i run /etc/init.d/opennebula-flow start it returns errors: “treetop gem version must be >= 1.6.3. Current version is 1.4.14 (RuntimeError)”

gem list:
treetop (1.6.8, 1.4.14)

When server starting it use 1.4.14, installed by deb package

Hi pezzak,

I am facing the same problem,

have you been able to solve this issue?


Yep, i’ve solved, but not the best way. I’ve removed ruby-*.deb dependencies from opennebula deb packages, and then install they via gem.
I don’t understand, why maintainers add this dependencies if there is /usr/share/one/install_gems script.

I still don’t know the rationale because this was added for 5.0.2 (it was not present on 5.0.1). AFAIK the gem version packaged in debian 8 and Ubuntu 16.04 are OK. Probably we’ve just overlooked the version in Ubuntu 14.04.

We’ll look into this to have it working for the next release. Sorry for the problems caused.

Meanwhile you can modify the file /usr/lib/one/oneflow/lib/models/role.rb ad add this gem statement just before the requires:

# Unless required by applicable law or agreed to in writing, software        #
# distributed under the License is distributed on an "AS IS" BASIS,          #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
# See the License for the specific language governing permissions and        #
# limitations under the License.                                             #
#--------------------------------------------------------------------------- #

gem 'treetop', '>= 1.6.3'

require 'treetop'
require 'treetop/version'
require 'grammar'
require 'parse-cron'

if !(Gem::Version.create(Treetop::VERSION::STRING) >= Gem::Version.create('1.6.3'))
    raise "treetop gem version must be >= 1.6.3. Current version is #{Treetop::VERSION::STRING}"

I use Ubuntu 14.04 and Opennebula 5.0.1
When I was beginning work with opennebula, I had problems with gem modules.
I did this:

  • sudo apt-get install ruby2.0 ruby2.0-dev
  • sudo rm /usr/bin/ruby && sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
  • sudo rm -fr /usr/bin/gem && sudo ln -s /usr/bin/gem2.0 /usr/bin/gem
  • /usr/share/one/install_gems

treetop (1.6.7, 1.6.5)

May it will be helpful

Finally I’ve done what jfontan said and now is working fine.

Thanks everyone for your suggestions.


Have the same issues with 5.0.2 on Debian Jessie, is this something that has been fixed in the 5.2 release?

In 5.2 this should be fixed. We’ve change the way of installing gems.

If you want to use it in 5.0.2 you can download these files to /usr/share/one and execute install_gems: