0

我第一次尝试在基于 JRuby 的项目中设置 Rails 可安装引擎(必要)。

引擎是空的,只有一个“hello world”测试控制器+视图,没有任何模型,没有使用 JSON。我尝试运行“捆绑安装”,它顺利通过,没有任何错误。

当我使用 'rake engine_name:install:migrations' 运行测试应用程序的初始数据库迁移时,它会引发错误:

rake aborted!
Could not find json-1.7.7 in any of the sources
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:90:in `block in materialize'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `map!'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `materialize'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/definition.rb:113:in `specs'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/definition.rb:158:in `specs_for'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/definition.rb:147:in `requested_specs'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/environment.rb:23:in `requested_specs'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:11:in `setup'
/home/user/.rvm/gems/jruby-1.7.2@global/gems/bundler-1.2.3/lib/bundler.rb:116:in `setup'

这是默认的 Gemfile.lock:

PATH
  remote: .
  specs:
    project_name (0.0.1)
      rails (~> 3.2.6)

GEM
  remote: http://rubygems.org/
  specs:
    actionmailer (3.2.12)
      actionpack (= 3.2.12)
      mail (~> 2.4.4)
    actionpack (3.2.12)
      activemodel (= 3.2.12)
      activesupport (= 3.2.12)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.12)
      activesupport (= 3.2.12)
      builder (~> 3.0.0)
    activerecord (3.2.12)
      activemodel (= 3.2.12)
      activesupport (= 3.2.12)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activerecord-jdbc-adapter (1.2.7)
    activerecord-jdbcmysql-adapter (1.2.7)
      activerecord-jdbc-adapter (~> 1.2.7)
      jdbc-mysql (~> 5.1.0)
    activeresource (3.2.12)
      activemodel (= 3.2.12)
      activesupport (= 3.2.12)
    activesupport (3.2.12)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    arel (3.0.2)
    builder (3.0.4)
    erubis (2.7.0)
    hike (1.2.1)
    i18n (0.6.1)
    jdbc-mysql (5.1.22.1)
    journey (1.0.4)
    jquery-rails (2.2.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.7.7)
    json (1.7.7-java)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.21)
    multi_json (1.6.1)
    polyglot (0.3.3)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.12)
      actionmailer (= 3.2.12)
      actionpack (= 3.2.12)
      activerecord (= 3.2.12)
      activeresource (= 3.2.12)
      activesupport (= 3.2.12)
      bundler (~> 1.0)
      railties (= 3.2.12)
    railties (3.2.12)
      actionpack (= 3.2.12)
      activesupport (= 3.2.12)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.0.3)
    rdoc (3.12.1)
      json (~> 1.4)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thor (0.17.0)
    tilt (1.3.3)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.35)

PLATFORMS
  java
  ruby

DEPENDENCIES
  activerecord-jdbcmysql-adapter
  engine_name!
  jquery-rails


Here is default Gemfile:

source "http://rubygems.org"
gemspec
gem "jquery-rails"

当我在 Ruby(而不是 JRuby)上进行相同的运行时,一切正常,没有任何问题。

你对这个主题没有任何想法或经验吗?

谢谢!:)

4

1 回答 1

0

bundle update可能会有所帮助.. 我看到一些情况bundle install不足以修复这种错误消息

于 2013-02-22T03:51:58.600 回答