Using the Ruby Distribution for Ice 3.7.3

This page provides important information for users of the Ice for Ruby distribution.

On this page:

Overview of the Ice for Ruby Distribution

Ice for Ruby is available as a collection of Ruby gems. Each package provides the following components:

  • Ice extension for Ruby
  • Standard Slice files
  • Slice-to-Ruby compiler (slice2rb)


Installing the Ice for Ruby Distribution

Linux and macOS users can install Ice for Ruby using this command:

gem install zeroc-ice

This gem builds Ice for Ruby from source and supports Ruby 2.0 or later.

On macOS 10.14 (Mojave) with Xcode 11 installed, you will need to use the command line tools to install the GEM. This can be achieved by installing the command line tools with xcode-select --install and setting DEVELOPER_DIR=/Library/Developer/CommandLineTools in your environment before running the gem install command above. Alternatively, you can install the macOS SDK headers using the /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg package. This is necessary to use the Ruby 2.3 headers instead of the Ruby 2.6 headers which are provided by default with the Xcode 11 macOS 10.15 SDK.


Using Ice for Ruby

The installation process automatically adds the Ice modules to Ruby's package directory and adds the Slice-to-Ruby compiler (slice2rb) to a directory that's likely already in your executable search path. To verify that Ice is installed, execute these commands:

irb
irb> require 'Ice'
irb> Ice::getSliceDir()

The output of getSliceDir shows where the standard Slice files have been installed.

The Ice manual provides a complete description of the Ruby mapping, including the options for generating Ruby code from Slice definitions.

 

Using the Sample Programs

Sample programs are provided in a separate GitHub repository. You can browse this repository to see build and usage instructions for all supported programming languages. Simply clone this repository:

git clone -b 3.7 https://github.com/zeroc-ice/ice-demos.git
cd ice-demos