嗨,
我是 JRuby on Rails 的新手。我安装了 RadRails 和许多 gem:
宝石
- 活动记录(2.3.4)
- ActiveRecord-JDBC (0.5)
- activerecord-jdbc-适配器 (1.2.9)
- activerecord-jdbcmysql-适配器 (1.2.9)
- jdbc-mysql (5.1.24)
书: http: //koti.kapsi.fi/jamo/priv2/JRuby%20on%20Rails,%202007.pdf
我阅读了第 4 章中名为“商店管理”的以下部分,并将 config/database.yml 修改为:
development:
adapter: jdbc
driver: com.mysql.jdbc.Driver
url: jdbc:mysql://my_host/my_database
username: my_user
password: my_pass
我在构建路径中添加了以下内容:
C:\Program Files\Aptana RadRails\plugins\org.jruby_1.2.0.9419p2\lib\ruby\gems\1.8\gems\jdbc-mysql-5.1.24\
当我重新启动服务器时,出现以下错误:
Status: 500 Internal Server Error
The driver encountered an error: cannot load Java class com.mysql.jdbc.Driver
C:/Program Files/Aptana RadRails/plugins/org.jruby_1.2.0.9419p2/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/active_record/connection_adapters/jdbc_adapter.rb:265:in `initialize'
C:/Program Files/Aptana RadRails/plugins/org.jruby_1.2.0.9419p2/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/active_record/connection_adapters/jdbc_adapter.rb:41:in `jdbc_connection'
我想请你帮忙。