views:

442

answers:

1

I was trying to create a quick little script that would insert data into an SQLite db for me but I can't get past the first few steps. I have done "sudo gem install sqlite3-ruby", my Ruby version is 1.8.7 (I used the Ruby one click installer from rubyforge.org).

My script is incredibly simple. It looks like this:

#!/usr/bin/ruby -w
require "csv.rb"
require "sqlite3"

begin
  CSV.open('updateddata.sql', 'r') do |row|
     p row
end
rescue => err
    puts "Exception : #{err}"
    err
end

It never makes it past the line require "sqlite3". It just errors and tells me that it can't find that file to load.

I don't understand how it won't work even after using the One click installer (which is supposed to have SQLite built into the install).

I'm not even sure where to go from here.

I am not a Ruby developer at all, I just wanted to use it as a learning experience and to quickly complete this task for myself.

+5  A: 

Dunno if Ruby in OS X behaves differently, but normally you need to do require 'rubygems' before requiring any gems.

hrnt
Well hell in a handbasket that was too easy.Thank you very much sir. Sorry about the newbish question.
Pselus