Digital Sanctum

software development, technology and other square topics

Archive for the ‘Tutorials’ Category

Installing Oracle Instant Client on Mac OS X

with 4 comments

Installing Oracle Instant Client on Mac OS X



Getting right down to business...

  1. Download the Instant Client Packages (4 files)
  2. Unzip the files into instantclient10_1
    CODE:
    1. unzip instantclient-basic-macosx-10.1.0.3.zip
    2. unzip instantclient-sqlplus-macosx-10.1.0.3.zip
    3. unzip instantclient-sdk-macosx-10.1.0.3.zip
    4. unzip instantclient-jdbc-macosx-10.1.0.3.zip

  3. Create two symbolic links for the files that have the version appended. This is so the Ruby OCI8 driver can find what it’s looking for.
    CODE:
    1. cd instantclient10_1
    2. ln -s libclntsh.dylib.10.1 libclntsh.dylib
    3. ln -s libocci.dylib.10.1 libocci.dylib
    4. cd ..

  4. Create directory /usr/local/oracle and then copy instantclient10_1 into it
    CODE:
    1. sudo mkdir /usr/local/oracle
    2. sudo mv instantclient10_1 /usr/local/oracle/instantclient10_1

  5. Open the system /etc/profile
    sudo pico /etc/profile
  6. Add these lines to /etc/profile
    CODE:
    1. DYLD_LIBRARY_PATH="/usr/local/oracle/instantclient10_1"
    2. export DYLD_LIBRARY_PATH
    3. SQLPATH="/usr/local/oracle/instantclient10_1"
    4. export SQLPATH

    Add /usr/local/oracle/instantclient10_1 to your PATH while you have /etc/profile open. Then save it.

  7. Reload your profile

    source /etc/profile
  8. Test it out with the sqlplus command line app.
    CODE:
    1. sqlplus [username][/password]@//[hostname][:port][/database]

If you can connect with that, then you’re good to go.

Written by Shane

July 26th, 2007 at 10:57 am

JRuby: Deploying a Rails Application on Tomcat

with 9 comments

JRuby: Deploying a Rails Application on TomcatThis is a brief tutorial on how to get a simple Ruby on Rails application up and running on Tomcat.

What you will need

  1. subversion client
  2. Java 5 JDK
  3. Tomcat 5.5.x
  4. JRuby 1.0
  5. Ruby on Rails
  6. ActiveRecord-JDBC gem
  7. goldspike Rails plugin (allows you to create a deployable war from an existing Rails app)
  8. MySQL database
  9. mysql-connector JDBC driver


Assumptions and Notes

It's assumed that you know your way around a Java development environment and have a JDK, Tomcat, MySQL and a subversion client installed already. From there you need to download and install JRuby. Once you have JRuby installed, there are some things to note:

  1. Most importantly, I had issues with the fact that I had an existing install of Ruby on Rails installed which caused me problems when installing gems, etc. with JRuby. If you have an existing install of RoR, just be sure you are working with the gem executable in your <jruby-install-dir>/bin and not your existing gem executable associated with RoR.
  2. People including myself have had classpath issues when trying to call Java libraries. In general, I've been able to workaround these issues by including library dependencies (in the form of a jar) in the <jruby-install-dir>/lib directory.

Read the rest of this entry »

Written by Shane

July 24th, 2007 at 6:39 pm

JRuby: An Introduction and Install Guide

without comments

What is JRuby?

JRuby is simply a Java implementation of the Ruby programming language.
Read the rest of this entry »

Written by Shane

July 23rd, 2007 at 5:14 pm

Best of Both Worlds: Java, Spring and Ruby Using JRuby

without comments

JRubyI've started putting together some resources related to JRuby and the Spring framework. There is a lot of interest in being able to write a Rails application and deploy it to an existing Java platform. I've been fortunate enough to land a job where I can spend a bit more time dedicated to mixing up Ruby and Java projects with the goal of speeding up development while still leveraging existing Java skills and platforms.

Written by Shane

July 17th, 2007 at 1:05 pm

Helpful Guides for Bash Scripting

without comments

Once in a while I create bash scripts to do various things on a Linux box. I'm by no means a bash scripting guru so I rely on various references:

  1. An in-depth exploration of the art of shell scripting
  2. A quick guide to writing scripts using the bash shell
  3. BASH Programming - Introduction HOW-TO

Written by Shane

March 20th, 2007 at 9:33 am

Posted in Linux, Tutorials