开发者

problem for SQLite db for jruby

I tried to use SQLite databse for my jruby project.

When i tried to install sqlite3 gem getting the following error

C:\tibbr\main\community_manager>gem install sqlite3-ruby

Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension.

C:/tibbr/main/tools/jruby/bin/jruby.exe extconf.rb WARNING: JRuby does not support native extensions or the mkmf' library. Check http://kenai.com/projects/jruby/pages/Home for alternatives. extconf.rb:10: undefined methoddir_config' for main:Object (NoMethodError)

Gem files will remain installed in C:/tibbr/main/tools/jruby/lib/ruby/gems/1.8/gems/sqlite3-1.3.4 for inspection. Results logged to C:开发者_Python百科/tibbr/main/tools/jruby/lib/ruby/gems/1.8/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out

Any suggestions? Thanks in advance


Yes, JRuby doesn't like native extensions. This is one of a few that I've run into so far. As senthil mentions, switch to the jdbc adapter addresses this issue. An example of the config change:

Gemfile

# gem 'sqlite3'
gem 'activerecord-jdbcsqlite3-adapter', :require => 'jdbc-sqlite3', :require =>'arjdbc'


its very simple, we need a jave (sqlitejdbc-v056.jar) lib file to support with jruby.

And i am using jdbc adapter for my project and using gem (activerecord-sqlite3-adapter). Its working fine. Sorry for very simple question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜