Я пытаюсь использовать Rails 2.3.2 с MySQL 5.0 на Windows XP, но безуспешно.
Я установил MySQL и могу запустить его, добавить таблицы и т. Д.
В ruby инструкция require 'mysql' проходит, но когда он достиг первого действия, я получаю
> C:/Development/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:7:in `define_all_hashes_method!': Mysql not loaded (RuntimeError)
from C:/Development/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:71:in `mysql_connection'
from C:/Development/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
from C:/Development/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from C:/Development/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from C:/Development/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
Есть идеи, что я делаю не так?
require 'rubygems'
require 'activerecord'
require 'mysql'
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "127.0.0.1",
:database => "ruby"
)
class Student < ActiveRecord::Base
end
Student.find(:all)