【问题标题】:JRuby JDBC-mysql errorJRuby JDBC-mysql错误
【发布时间】:2012-04-06 16:48:49
【问题描述】:

我有 JRuby + Swing 应用程序并想在此处添加 jdbc/mysql

require "jdbc/mysql"

但是当我尝试运行它时,出现以下错误:

LoadError: no such file to load -- jdbc/mysql
  require at org/jruby/RubyKernel.java:1033
   (root) at olap_frontend.rb:3

我的宝石清单:

*** LOCAL GEMS ***

activerecord-jdbc-adapter (1.2.2)
activerecord-jdbcmysql-adapter (1.2.2)
bouncy-castle-java (1.5.0146.1)
bundler (1.1.3 ruby)
jdbc-mysql (5.1.13)
jruby-launcher (1.0.12 java)
jruby-openssl (0.7.6.1)
rake (0.9.2, 0.8.7)
rubygems-bundler (0.3.0 ruby)

我做错了什么?

【问题讨论】:

  • 尝试需要“active_record”
  • LoadError: no such file to load -- active_record require at org/jruby/RubyKernel.java:1033 (root) at olap_frontend.rb:4

标签: mysql jdbc jruby


【解决方案1】:

这是我的错 - 我需要先要求 rubygems

【讨论】:

  • 如果有人在使用 Ruby 1.9 时遇到这种情况,这只是 1.8 中的问题。 1.9 自动需要 ruby​​gems。
猜你喜欢
  • 2013-06-24
  • 2012-05-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-03-07
  • 2016-12-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多