Skip to content

Instantly share code, notes, and snippets.

@tegansnyder
Last active December 21, 2015 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegansnyder/77fae6acee4fd4ddc52c to your computer and use it in GitHub Desktop.
Save tegansnyder/77fae6acee4fd4ddc52c to your computer and use it in GitHub Desktop.
RHEL 6 - Ruby / JRuby install for Nordstrom/tdsql - Command line toolbelt for Teradata

Steps to get Ruby install on RHEL and JRuby with RVM for Teradata toolkit found here: https://github.com/Nordstrom/tdsql

# sudo -s or dzdo
dzdo -s

# instal ruby from RHEL packagemantent
yum install ruby

# grab the rvm key
curl -#LO https://rvm.io/mpapis.asc
gpg --import mpapis.asc
curl -sSL https://get.rvm.io | bash -s stable

# add to rvm group
vi /etc/group
rvm:x:5002:YOURUSERNAMEHERE

# refresh bash
source /etc/profile.d/rvm.sh
source /etc/profile

# install ruby 2.1
rvm install 2.1
ruby -v
rvm use 2.1 --default

# install jruby
rvm install jruby-1.7.18
rvm use jruby-1.7.18

# confirm jruby installed
jruby -v

# install jruby bundler
jruby -S gem install bundler

# grab the tdsql repo
git clone https://github.com/Nordstrom/tdsql.git

# move to the root of the repo
cd tdsql

# install tdsql bundle 
jruby -S bundle install

# make tdsql executable
chmod +x tdsql

# verify tdsl outputs
./tdsql --help

# note you may get errrors about
# Unknown ruby string (do not know how to handle): jruby-1.7.18.
# see: https://github.com/rvm/rvm/issues/3292

# try a query:
tdsql -h hostname_here -u your_user_name -p your_pass -c "SELECT TOP 5 WAREH1.TBL1.SOMEFIELD FROM WAREH1.TBL1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment