문제

When I try to run the following, I get an error back from ActiveRecord stating that the connector hasn't been found.

require 'activerecord'
ActiveRecord::Base.establish_connection(
    :adaptor => "sqlite3", 
    :database => "db.sqlite3"
)

Error Message:

>> ActiveRecord::Base.establish_connection("adaptor" => "sqlite3-ruby")
ActiveRecord::AdapterNotSpecified: database configuration does not specify 
    adapter from
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/
gems/activerecord/2.2.2/lib/active_record/connection_adapters/abstract/
connection_specification.rb:64:in `establish_connection'

Is the ActiveRecord gem broken, or is the initial code incorrect?

도움이 되었습니까?

해결책

Looks like you misspelled "adapter" in your arguments. -er and -or are both proper in English, but does AR expect a specific one? Judging by the error message, they want -er.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top