0

JRuby を使用しており、特定のバージョンの gem を取得する必要があります。

C:\>gem list activerecord-jdbcsqlite3-adapter --remote --all

*** REMOTE GEMS ***

activerecord-jdbcsqlite3-adapter (1.2.6, 1.2.5, 1.2.2.1, 1.2.2, 1.2.1, 1.2.0, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.3 java, 1.0.2 java, 1.0.1 java, 1.0.0 java, 0.9.7
java, 0.9.6 java, 0.9.5 java, 0.9.4 java, 0.9.3 java, 0.9.2, 0.9.1, 0.9.0.1, 0.9, 0.8.2, 0.8.1)

わかりましたので、これをGemfileに入れます:

gem 'activerecord-jdbcsqlite3-adapter', '=1.0.3 java'

しかし、バンドルはそれを理解していません:

C:\bundle install
c:/soft/jruby-1.6.8/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:81:in `parse': Illformed requirement ["=1.0.3 java"] (ArgumentError)
       c:/soft/jruby-1.6.8/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:106:in `initialize'
       org/jruby/RubyArray.java:2379:in `map!'
       c:/soft/jruby-1.6.8/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:106:in `initialize'
       c:/soft/jruby-1.6.8/lib/ruby/site_ruby/1.8/rubygems/requirement.rb:44:in
`create'
       c:/soft/jruby-1.6.8/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:50:in `initialize'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/dependency.rb:28:in `initialize'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/dsl.rb:72:in `gem'
       C:/Users/IBM_ADMIN/test_jdbc_rails_sqlite/Gemfile:9:in `(eval)'
       org/jruby/RubyKernel.java:2086:in `instance_eval'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/dsl.rb:32:in `eval_gemfile'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/dsl.rb:7:in `evaluate'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/definition.rb:18:in `build'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler.rb:144:in `definition'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/cli.rb:228:in `install'
       org/jruby/RubyKernel.java:2105:in `send'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/vendor/thor/task.rb:27:in `run'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/vendor/thor.rb:275:in `dispatch'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/vendor/thor/base.rb:408:in `start'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/bin/bundle:14:in `(root)'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
       c:/soft/jruby-1.6.8/lib/ruby/gems/1.8/gems/bundler-1.2.3/bin/bundle:14:in `(root)'
       org/jruby/RubyKernel.java:1087:in `load'
       c:\soft\jruby-1.6.8\bin\bundle:23:in `(root)'
There was an error in your Gemfile, and Bundler cannot continue.

私は何を間違っていますか?

4

1 に答える 1

2

私はあなたが探していると思います:

gem 'activerecord-jdbcsqlite3-adapter', '=1.0.3', :platforms => :jruby

しかし、jruby を使用している場合は、おそらくプラットフォームの部分は必要ありません。

于 2013-02-08T15:25:35.883 に答える