Ich versuche, Rails 2.3.2 mit MySQL 5.0 auf Windows XP ohne Glück zu verwenden.
Ich habe MySQL installiert und bin in der Lage, um sie auszuführen, fügen Sie Tabellen usw.
In Rubin, so geht die require ‚mysql‘ Aussage aber onde es die erste Aktion dann erreicht bekomme ichMySQL/Ruby unter Windows
> 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'
Jede Idee, was Ich mache falsch?
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)
Wie sehen Ihre Pfade aus? Können Sie irb von der Befehlszeile aus aufrufen? –
Ja, haben beide Ruby/bin und mysql/bin in meinem Pfad –
Rails 3.2.3 ist noch nicht freigegeben. Vielleicht reden Sie über Rails 2.3.2 ...;) –