首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

最新版RoR+MySQL出现的有关问题

2012-02-05 
最新版RoR+MySQL出现的问题Ruby 1.9.2 + Rails 3.0.3 + MySQL 5.1先安装的Ruby 1.9.2,后安装的MySQL 5.1。

最新版RoR+MySQL出现的问题
Ruby 1.9.2 + Rails 3.0.3 + MySQL 5.1
先安装的Ruby 1.9.2,后安装的MySQL 5.1。把MySQL装完后bin目录下的“libmySQL.dll”拷贝到Ruby装完后的bin目录下。
MySQL的gem为mysql2 (0.2.6 x86-mingw32)

创建新项目时命令如下:
rails new simple_cms -d mysql

运行时Framework Trace如下:

mysql2-0.2.6-x86 (mingw32) lib/mysql2/client.rb:37:in `connect'
mysql2-0.2.6-x86 (mingw32) lib/mysql2/client.rb:37:in `initialize'
mysql2-0.2.6-x86 (mingw32) lib/active_record/connection_adapters/mysql2_adapter.rb:14:in `new'
mysql2-0.2.6-x86 (mingw32) lib/active_record/connection_adapters/mysql2_adapter.rb:14:in `mysql2_connection'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:228:in `new_connection'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:236:in `checkout_new_connection'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `block (2 levels) in checkout'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `loop'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `block in checkout'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `checkout'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:93:in `connection'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:316:in `retrieve_connection'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:10:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

怎么回事呢?

[解决办法]
好像还要

Perl code
gem install mysql
[解决办法]
你的错误提示里没有你说的 can't convert Fixnum into String。 如果单凭这个提示就是说不能从String型转化为Fixnum型。 具体你要看下是哪一步提示的

热点排行