Installing the ODBC Adapter for Active Record / Ruby on Rails
Having downloaded the adapter, unpack it into a temporary directory:
zsh, pizza 4:04PM ruby/ % tar xvpfz ~/Downloads/rails-odbc-1.0.tgz rails-odbc-1.0/ rails-odbc-1.0/AUTHORS rails-odbc-1.0/ChangeLog rails-odbc-1.0/COPYING rails-odbc-1.0/doc/ ...
Change into the rails-odbc-1.0/ directory and you should see the following files:
zsh, pizza 4:09PM ruby/ % cd rails-odbc-1.0 zsh, pizza 4:09PM rails-odbc-1.0/ % ls AUTHORS NEWS install_odbc.rb COPYING README lib/ ChangeLog Rakefile support/ LICENSE doc/ test/ zsh, pizza 4:10PM rails-odbc-1.0/ %
From here, you only need to run the install_odbc.rb script (as root) and it should copy all the files into the right locations:
zsh, pizza 4:11PM rails-odbc-1.0/ # ruby install_odbc.rb << Installation script for Rails ODBC Adapter >> Checking if Locomotive is installed Checking if RubyGems is installed. Looking for installed ActiveRecord gems. Target ActiveRecord directory for install: [/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record] Enter c to change target ActiveRecord directory, q to quit, i to install i Copying ODBC Adapter files into the ActiveRecord tree. ------------------------------------------------------------ ./vendor/odbcext_virtuoso.rb -> \ /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/./vendor/odbcext_virtuoso.rb chmod 0644 \ /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/./vendor/odbcext_virtuoso.rb ... ./connection_adapters/odbc_adapter.rb -> \ /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/./connection_adapters/odbc_adapter.rb chmod 0644 \ /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/./connection_adapters/odbc_adapter.rb ------------------------------------------------------------ Checking RAILS_CONNECTION_ADAPTERS (active_record.rb) includes odbc. Checking for Ruby ODBC Bridge. odbc.bundle found in /usr/lib/ruby/site_ruby/1.8/powerpc-darwin8.0 Done. zsh, pizza 4:12PM rails-odbc-1.0/ #
As shown above, the install script will automatically detect where your existing Active Record installation is located, whether you're using Locomotive on the Mac or not. (The above shows it running on Mac OS X Tiger with the default system-wide ruby installation paths.) Running it as `ruby install_odbc.rb' requires that you have the right ruby executable in your PATH.