Installing alternate Ruby interpreter
By default, all automation scripts are run on JRuby. For Local Ruby automation scripts, you can use an alternate Ruby interpreter.
Installing and compiling alternate Ruby 1.9.3 on CentOS
This section describes how to install and compile alternate Ruby on CentOS. For installing on other operating systems, see the Ruby documentation.
- On the BMC Release Process Management server, go to command prompt and verify and install the required packages for alternate Ruby:
- gcc-c++
- patch
- readline
- readline-devel
- zlib
- zlib-devel
- libyaml-devel
- libffi-devel
- openssl-devel
For example, to install the packages, run the following command:
yum install <package-name>
To download alternate Ruby installer, run the following commands:
cd /tmp
wget https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.zipTo unzip the zip package, run the following command:
unzip ruby-1.9.3-p551.zipTo go to the directory where the installer is unzipped, run the command:
cd ruby-1.9.3-p551To create a new directory to install alternate ruby, run the following commands one after another:
mkdir /opt/rubies
mkdir /opt/rubies/ruby193To specify the required configuration and install alternate Ruby, run the following commands:
./configure --prefix=/opt/rubies/ruby193
make
make installTo verify if the alternate Ruby is installed successfully, run the following command:
export PATH=$PATH:/opt/rubies/ruby193/bin
ruby -vThe following output shows whether the alternate Ruby is installed successfully:
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]- After the alternate Ruby is installed, install the required Ruby gems.
Install Ruby gems
After installing and compiling Ruby 1.9.3, perform the following steps to install the required ruby gems. You can install gems by using either of the following two methods.
Install gems by using Ruby commands
Go to the command prompt and run the following command to set ruby executable path.
(Linux) export PATH=$PATH:/opt/rubies/ruby193/bin
(Windows) set PATH=%RUBY_INSTALL_DIR%\bin;%PATH%Run the following commands to install each gem.
gem install hudson-remote-api -v=0.7.0
gem install rack -v=1.4.7
gem install nokogiri -v=1.6.8
gem install savon -v=1.1.0
gem install ffi -v=1.9.3
gem install rest-client -v=1.7.2
gem install xml-simple -v=1.1.3
gem install net-ssh -v=2.3.0
gem install net-sftp -v=2.0.5
gem install net-scp -v=1.0.4
gem install net-ssh-gateway -v=1.1.0Run the following command to verify the list of installed gems:
gem listThe following figure shows the complete list of installed gems.
Copy compiled gems to the installed Ruby
- Obtain the C-Ruby Gems file from BMC Customer Support to download all compiled CRubyGems.
- Back up the <CRUBY-INSTALL-DIR> directory.
For example, back up the /opt/rubies/ruby193 directory. - Extract the Cruby.zip, which contains the following files.
- gems.zip
- specifications.zip
- Extract the gems.zip file and copy the contents in the gems file to the <CRUBY-INSTALL-DIR>/lib/ruby/gems/1.9.1/gems location.
- Extract the specifications.zip file and copy the contents in the specifications file to the <CRUBY-INSTALL-DIR>/lib/ruby/gems/1.9.1/specifications location.
Run the command to set the Ruby executable path.
export PATH=$PATH:/opt/rubies/ruby193/binRun the following command to view a list of installed gems.
gem listThe following figure shows the complete list of installed gems.
Related topics
Automation-steps-fail-with-error-require-cannot-load-such-file-hudson-remote-api