Search code examples
rubycloud-foundryvmc

which version of ruby is needed for CloudFoundry?


when I try to manager my mysql service by vmc tool. I got a error like below:

$ vmc tunnel cucgp --port 9999 mysql
Getting tunnel connection info: OK

Service connection info: 
  username : uxpHWCAlOdElr
  password : pIw5h2MKQjDOI
  name     : d4bbe4b16b3904c41bd5ff42c1df92b7a

Starting tunnel to cucgp on port 9999.
Launching 'mysql --protocol=TCP --host=localhost --port=9999 --user=uxpHWCAlOdElr --password=pIw5h2MKQjDOI d4bbe4b16b3904c41bd5ff42c1df92b7a'

terminate called after throwing an instance of 'std::runtime_error'
  what():  Encryption not available on this event-machine
已放弃
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
$ vmc -v
vmc 0.3.18

Is that some trouble with my ruby version?I just install it with apt from ubuntu source. At the end, I make apologies for my poor English.


Solution

  • we recommend you use at least version 1.9.2 or Ruby, the easiest way to install this is with RVM - https://rvm.io/rvm/install/, have a good scan over this site before continuing

    To install it, just run the following command in a terminal window;

    $ curl -L https://get.rvm.io | bash -s stable --ruby
    

    RVM allows you to manage multiple versions of ruby, it also stores any gems installed for that version in your users home path which means you can install gems without having to use sudo!

    Once RVM is installed, I would go ahead and install version 1.9.3 of Ruby;

    $ rvm install 1.9.3
    

    Then tell RVM to use this version by default

    $ rvm use 1.9.3 --default
    

    Once you have done this you need to re-install any gems you may have previously installed for 1.8.7, so re-install vmc and caldecott

    $ gem install vmc
    $ gem install caldecott