Transactd Installation Guide for Ruby
Build and installation has been simplified from Transactd 2.4.2. (Especially on Linux / Mac OS X)
If you want to build 2.4.0 or earlier version, please see the old document.
Install Transactd client according to Ruby you are using, and exec tests.
1. Installation according to Ruby you are using
Installing pre-built binary for ActiveScriptRuby (Windows)
If you use one of the following versions ActiveScriptRuby, you can install pre-built binaries.
- ActiveScriptRuby Ruby-2.2.0-p0
- ActiveScriptRuby Ruby-2.2.0-p0(x64)
- ActiveScriptRuby Ruby-2.1.2-p95
- ActiveScriptRuby Ruby-2.1.1-p76(x64)
- ActiveScriptRuby Ruby-2.0.0-p195
- ActiveScriptRuby Ruby-2.0.0-p195(x64)
- ActiveScriptRuby Ruby-1.9.3-p429
In installation of pre-built binaries, you can install according to following procedure.
- Open command prompt with administrator privileges.
- Install the Gem with the following command:
gem install transactd --platform=x64-mswin64-100 ::for 64bit Ruby gem install transactd --platform=x86-mswin32-100 ::for 32bit Ruby
In the command, following will be done:
- Download the pre-built binary package.
- Install client for Ruby (transactd.so) and script files into Transactd Gem folder.
- Install clients for C/C++ (tdclc_*.dll, tdclcpp_*.dll) into Windows system folder (System32 or SysWOW64).
Building and installing from source code
Currently, there is no pre-built binary available for Ruby other than the above.
For other Ruby, please build and install according to the instructions below:
- 2. Building and installing on Linux
- 3. Building and installing on Windws (MinGW)(RubyInstaller)
- 4. Building and installing on Windows (Visual Studio)
2. Building and installing on Linux
Here, I example build and install in Ubuntu.
2-1. Install CMake
Transactd clients requires CMake to build them.
sudo aptitude install cmake
2-2. Install SWIG (for Transactd 2.0 or earlier)
Ruby client for Transactd 2.0 or earlier requires SWIG (2.0 or later) to build them. It is not required by Transactd 2.1 or later.
sudo aptitude install swig2.0
2-3. Download and build Boost C++ Libraries
Download source code from Boost download page and extract it.
cd ~
wget http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz/download \
-O boost_1_58_0.tar.gz
tar xzf boost_1_58_0.tar.gz
Run following commands to build Boost:
cd ~/boost_1_58_0
./bootstrap.sh --with-libraries=chrono,filesystem,system,thread,timer,serialization,program_options
./b2 cxxflags=-fPIC
2-4. Install Transactd client
Then run following commands to build and install Transactd clients:
gem install transactd -- --boost=~/boost_1_58_0
In the command, following will be done:
- Download the source code package.
- Build clients for Ruby (transactd.so), C/C++ (libtdclc_*.so, libtdclcpp_*.so).
- Install client for Ruby and script files into Transactd Gem folder.
- Install clients for C/C++ into /usr/lib (by default).
If you want to change the destination for C/C++ clients, please specify the following:
gem install transactd -- --boost=~/boost_1_58_0 \
--install_prefix=/usr/local/lib
3. Building and installing on Windws (MinGW)
The following steps are for Ruby built by MinGW, such as RubyInstaller. For Ruby built by Visual Studio, see Building and installing on Windows (Visual Studio).
If you do not know what Ruby you are using, run following command:
ruby --version
In the case of RubyInstaller (MinGW), devkit is required.
3-1. Download and install CMake
Download CMake Win32 Installer from CMake download page and run it.
Along the way, select "Add CMake to the system PATH for all (or current) users" to set path of cmake.exe.
3-2. Download and install SWIG (for Transactd 2.0 or earlier)
Ruby client for Transactd 2.0 or earlier requires SWIG (2.0 or later) to build them. It is not required by Transactd 2.1 or later.
Download latest swigwin-2.x.x.zip from SWIG download page and unzip it.
Then add folder path where swig.exe is to environment variable PATH. You can add the environment variable from [Control Panel] - [System] - [Advanced].
Start command prompt and run following command. If SWIG is installed correctly, version information is displayed.
swig -version
3-3. Download and build Boost C++ Libraries
Download Boost source code from Boost download pageand unzip it. Here, it is assumed that you have saved in the following folder.
C:\boost\boost_1_58_0
Start command prompt and set the path for the build tool MinGW.
If you are using RubyInstaller and devkit, there is a batch file to set variable. Just do it:
@REM ex. For RubyInstaller 2.0 64bit
C:\RubyInstaller\devkit200-x64\devkitvars.bat
Next, build Boost with following commands:
cd C:\boost\boost_1_58_0
bootstrap.bat gcc
@REM For 64bit
b2.exe -sTOOLS=mingw toolset=gcc threading=multi address-model=64 architecture=x86 ^
--with-chrono --with-filesystem --with-system --with-thread --with-timer ^
--with-serialization --with-program_options ^
variant=debug,release link=static runtime-link=static
@REM For 32bit
b2.exe -sTOOLS=mingw toolset=gcc threading=multi architecture=x86 ^
--with-chrono --with-filesystem --with-system --with-thread --with-timer ^
--with-serialization --with-program_options ^
variant=debug,release link=static runtime-link=static
3-4. Install Transactd client
Open command prompt with administrator privileges and install Transactd clients by running the following command:
gem install transactd -- "--boost=""C:\boost\boost_1_58_0"""
In the command, following will be done:
- Download gem package including pre-built binary for C (tdclc_*.dll) and source code.
- Build clients for Ruby (transactd.so).
- Install client for Ruby and script files into Transactd Gem folder.
- Install clients for C into Windows system folder (System32 or SysWOW64).
4. Building and installing on Windows (Visual Studio)
The following steps are for Ruby built by Visual Studio, such as ActiveScriptRuby. For Ruby built by MinGW, see Building and installing on Windows (MinGW).
If you do not know what Ruby you are using, run following command:
ruby --version
Visual Studio is required to build.If you are using Visual Studio 2010 Express, please refer to section 1 of Transactd Build Guide for Windows.
4-1. Download and install CMake
Download CMake Win32 Installer from CMake download page and run it.
Along the way, select "Add CMake to the system PATH for all (or current) users" to set path of cmake.exe.
4-2. Download and install SWIG (for Transactd 2.0 or earlier)
Ruby client for Transactd 2.0 or earlier requires SWIG (2.0 or later) to build them. It is not required by Transactd 2.1 or later.
Download latest swigwin-2.x.x.zip from SWIG download page and unzip it.
Then add folder path where swig.exe is to environment variable PATH. You can add the environment variable from [Control Panel] - [System] - [Advanced].
Start command prompt and run following command. If SWIG is installed correctly, version information is displayed.
swig -version
4-3. Download and install Boost C++ Libraries
Download and set up Boost according to according to procedure in section 3 of Transactd Build Guide for Windows..
4-4. Install Transactd client
Open command prompt with administrator privileges and install Transactd clients by running the following command:
gem install transactd -- "--boost=""C:\boost\boost_1_58_0"""
In the command, following will be done:
- Download the source code package.
- Build clients for Ruby (transactd.so), C/C++ (tdclc_*.dll, tdclcpp_*.dll).
- Install client for Ruby and script files into Transactd Gem folder.
- Install clients for C/C++ into Windows system folder (System32 or SysWOW64).
4. Exec tests
Transactd tests use RSpec. Install RSpec and exec test files in
source/bzs/test/tdclrb
, *_spec.rb
. For example:
rspec transactd_spec.rb
rspec transactd_v3_spec.rb