I'm trying to use ActiveRecord on the latest MacOS X Tiger, but it gives me this error when I try to instantiate my subclass of ActiveRecord::Base (after calling establish_connection)
Here's my small code snippet:
require 'rubygems' require_gem 'activerecord'
ActiveRecord::Base.establish_connection( :adapter => 'sqlserver', :database => 'ETT', :mode => 'ODBC', :dsn => 'Dev', :username => 'ETT_sa', :password => 'MR#Fko[!Iu', :host => '192.168.97.227' )
class Order < ActiveRecord::Base end
an_order = Order.new an_order.name = "Dave Thomas" an_order.email = "dave@pragprog.com" an_order.address = "123 Main St" an_order.pay_type = "check" an_order.save
The appropriate database exists and ODBC DSN is configured. I installed DBI several times and it is there, but can't find it.
Here is the error:
csh: /sw/bin/init.cs: No such file or directory. RubyMate Ruby
Theme: RubyMate r4913 running Ruby v1.8.4 ()
ar.rb
MissingSourceFile: no such file to load - dbi
method require__ in custom_require.rb at line 21 method require in custom_require.rb at line 21 method require in dependencies.rb at line 147 method require_library_or_gem in requires.rb at line 7 method silence_warnings in reporting.rb at line 11 method require_library_or_gem in requires.rb at line 5 method sqlserver_connection in sqlserver_adapter.rb at line 23 method connection_without_query_cache= in connection_specification.rb at line 251 method connection= in query_cache.rb at line 54 method retrieve_connection in connection_specification.rb at line 220 method connection in connection_specification.rb at line 78 method columns in base.rb at line 696 method attributes_from_column_definition in base.rb at line 1969 method initialize_without_callbacks in base.rb at line 1351 method initialize in callbacks.rb at line 236 at top level in ar.rb at line 17 Program exited.