I am trying to connect ActiveRecord to an sqlite3 database:
ActiveRecord::Base.establish_connection(:adapter=>‘sqlite3’,:database=>‘names.db’)
I am told:
Please install the sqlite3 adapter: gem install activerecord-sqlite3-adapter
(Could not find RubyGem sqlite3 (~> 1.3.5)
(LoadError)
I thought that I had the sqlite3 adapter installed. I have a file named
sqlite3_adapter.rb installed in
/usr/lib/ruby/gems/1.8/gems/activerecord-3.2.6/lib/active_record/connection_adapters.
I am not sure about the “(~> 1.3.5)” part. However, the first 3 lines
of the sqlite3_adapter.rb file read like this:
require ‘active_record/connection_adapters/sqlite_adapter’
gem ‘sqlite3’, ‘~> 1.3.5’
require ‘sqlite3’
When I do a “gem install activerecord-sqlite3-adapter” I am told that
that gem could not be found in any repository.
I am running Ruby 1.8.7 on CentOS 6.2. My version of sqlite is 3.6.20.
Can someone please tell me what I need to do to make this thing work? I
would really appreciate it. I’m at a loss. Thanks.
... doug