Installation¶
This guide will help you install SQA::TAI and its dependencies.
Prerequisites¶
SQA::TAI requires:
- Ruby >= 3.1.0
- TA-Lib C library >= 0.4.0
Step 1: Install TA-Lib C Library¶
The TA-Lib C library must be installed before the Ruby gem.
macOS¶
Using Homebrew:
Ubuntu/Debian¶
Build from source:
# Download TA-Lib
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
# Build and install
./configure --prefix=/usr
make
sudo make install
# Update library cache
sudo ldconfig
CentOS/RHEL/Fedora¶
# Download and extract
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
# Build and install
./configure --prefix=/usr
make
sudo make install
# Update library cache
sudo ldconfig
Windows¶
- Download the MSI installer from ta-lib.org
- Run the installer
- Add TA-Lib to your PATH
Step 2: Install Ruby Gem¶
Using Bundler (Recommended)¶
Add to your Gemfile:
Then run:
Using RubyGems¶
Verify Installation¶
Test that everything is working:
require 'sqa/tai'
# Check if TA-Lib is available
if SQA::TAI.available?
puts "✓ TA-Lib is installed and ready!"
puts "Version: #{SQA::TAI::VERSION}"
else
puts "✗ TA-Lib C library not found"
end
# Try a simple calculation
prices = [10, 11, 12, 13, 14, 15]
sma = SQA::TAI.sma(prices, period: 3)
puts "SMA test: #{sma}"
Troubleshooting¶
"TA-Lib not found" Error¶
If you get a "TA-Lib not installed" error:
-
Verify TA-Lib is installed:
-
Check library path:
-
Set library path (if needed):
Permission Errors¶
If you get permission errors during installation:
# Use sudo for system installation
sudo gem install sqa-tai
# Or use a Ruby version manager (recommended)
rbenv install 3.3.0
rbenv global 3.3.0
gem install sqa-tai
Build Failures on Linux¶
If compilation fails:
# Install build tools
sudo apt-get install build-essential
# Or on CentOS/RHEL
sudo yum groupinstall "Development Tools"