Archive for the ‘Tutorials’ Category
Installing Oracle Instant Client on Mac OS X
Getting right down to business...
- Download the Instant Client Packages (4 files)
- Unzip the files into
instantclient10_1CODE:-
unzip instantclient-basic-macosx-10.1.0.3.zip
-
unzip instantclient-sqlplus-macosx-10.1.0.3.zip
-
unzip instantclient-sdk-macosx-10.1.0.3.zip
-
unzip instantclient-jdbc-macosx-10.1.0.3.zip
-
- Create two symbolic links for the files that have the version appended. This is so the Ruby
OCI8driver can find what it’s looking for.CODE:-
cd instantclient10_1
-
ln -s libclntsh.dylib.10.1 libclntsh.dylib
-
ln -s libocci.dylib.10.1 libocci.dylib
-
cd ..
-
- Create directory
/usr/local/oracleand then copyinstantclient10_1into itCODE:-
sudo mkdir /usr/local/oracle
-
sudo mv instantclient10_1 /usr/local/oracle/instantclient10_1
-
- Open the system
/etc/profile
sudo pico /etc/profile - Add these lines to
/etc/profileCODE:-
DYLD_LIBRARY_PATH="/usr/local/oracle/instantclient10_1"
-
export DYLD_LIBRARY_PATH
-
SQLPATH="/usr/local/oracle/instantclient10_1"
-
export SQLPATH
Add
/usr/local/oracle/instantclient10_1to yourPATHwhile you have/etc/profileopen. Then save it. -
- Reload your profile
source /etc/profile
- Test it out with the
sqlpluscommand line app.CODE:-
sqlplus [username][/password]@//[hostname][:port][/database]
-
If you can connect with that, then you’re good to go.
JRuby: Deploying a Rails Application on Tomcat
This is a brief tutorial on how to get a simple Ruby on Rails application up and running on Tomcat.
What you will need
- subversion client
- Java 5 JDK
- Tomcat 5.5.x
- JRuby 1.0
- Ruby on Rails
- ActiveRecord-JDBC gem
- goldspike Rails plugin (allows you to create a deployable war from an existing Rails app)
- MySQL database
- 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:
- 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>/binand not your existing gem executable associated with RoR. - 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>/libdirectory.
JRuby: An Introduction and Install Guide
What is JRuby?
JRuby is simply a Java implementation of the Ruby programming language.
Read the rest of this entry »
Best of Both Worlds: Java, Spring and Ruby Using JRuby
I'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.
Helpful Guides for Bash Scripting
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:
