Hi
I would like to write my first application with Active
Record:
this is my database table:
id PRIMAREY KEY auto_increment
german_name varchar(50)
english_name varchar(50) |
wingspan
this is my code:
======================#!/usr/local/bin/ruby -w
require ''rubygems''
require_gem ''activerecord'', ">= 1.10.1"
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "localhost",
:username => "root",
:password => "passwd",
:database => "orm_test"
)
class Eagle < ActiveRecord::Base
end
eagle = Eagle.new
puts eagle.instance_methods
=========================
username, database name and password are correct.
but I get a lot of warnings and an error:
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/class_inheritable_attributes.rb:116:
warning: discarding old inherited
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:6:
warning: method redefined; discarding old pluralize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:14:
warning: method redefined; discarding old singularize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:22:
warning: method redefined; discarding old camelize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:26:
warning: method redefined; discarding old underscore
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:30:
warning: method redefined; discarding old humanize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:34:
warning: method redefined; discarding old demodulize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:38:
warning: method redefined; discarding old tableize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:42:
warning: method redefined; discarding old classify
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:46:
warning: method redefined; discarding old foreign_key
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:51:
warning: method redefined; discarding old constantize
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:58:
warning: method redefined; discarding old plural_rules
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:76:
warning: method redefined; discarding old
singular_rules
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/clean_logger.rb:7:
warning: method redefined; discarding old
format_message
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/validations.rb:277:
warning: `*'' interpreted as argument prefix
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/validations.rb:305:
warning: `*'' interpreted as argument prefix
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/abstract_adapter.rb:159:
warning: method redefined; discarding old default
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/sqlserver_adapter.rb:95:
warning: (...) interpreted as grouped expression
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/oci_adapter.rb:58:
warning: (...) interpreted asgrouped expression
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/oci_adapter.rb:103:
warning: ambiguous first argument; put parentheses or
even spaces
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/vendor/mysql411.rb:106:
warning: discarding old connect
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/vendor/mysql411.rb:163:
warning: method redefined; discarding old change_user
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/abstract_adapter.rb:422:in
`log'': Packets out oforder: 1<>3: SHOW FIELDS FROM
eagles (ActiveRecord::StatementInvalid)
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/mysql_adapter.rb:116:in
`execute''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/mysql_adapter.rb:105:in
`columns''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/base.rb:1307:in
`attributes_from_column_definition''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/base.rb:922:in
`initialize_without_callbacks''
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/callbacks.rb:239:in
`initialize''
from ./eagle_test.rb:19:in `new''
from ./eagle_test.rb:19
I installed the latest Rails version as a gem.
any ideas what''s wrong here ??
Markus
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:
http://mail.yahoo.de
On 5/23/05, Markus Jais <markus_jais-LWAfsSFWpa4@public.gmane.org> wrote:> Hi > > I would like to write my first application with Active > Record: > this is my database table: > > id PRIMAREY KEY auto_increment > german_name varchar(50) > english_name varchar(50) | > wingspan > > this is my code: > ======================> #!/usr/local/bin/ruby -w > > require ''rubygems'' > require_gem ''activerecord'', ">= 1.10.1" > > > ActiveRecord::Base.establish_connection( > :adapter => "mysql", > :host => "localhost", > :username => "root", > :password => "passwd", > :database => "orm_test" > ) > > > class Eagle < ActiveRecord::Base > end > > eagle = Eagle.new > > puts eagle.instance_methods > =========================> > username, database name and password are correct. > but I get a lot of warnings and an error: > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/connection_adapters/abstract_adapter.rb:422:in > `log'': Packets out oforder: 1<>3: SHOW FIELDS FROM > eagles (ActiveRecord::StatementInvalid) > from > > I installed the latest Rails version as a gem. > > > any ideas what''s wrong here ??You''ll need to install the C-based mysql driver, the ruby (slower) one gives this error Packets out oforder: 1<>3 gem install mysql> Markus > > > > > > > > > > > > > > ___________________________________________________________ > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz