使用JRuby的RoR引擎 - 初始迁移失败,不好

时间:2013-02-21 22:15:31

标签: ruby-on-rails-3.2 jruby rails-migrations rails-engines

我第一次尝试在项目中基于JRuby设置rails mountable引擎(必要)。

引擎只有一个'hello world'测试控制器+视图是空的,没有任何模型,没有使用JSON。 我尝试运行'bundle install'并且它没有任何错误地通过。

当我使用'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)时,一切都运行正常,没有任何问题。

你对这个主题有什么想法或经验吗?

THX! :)

1 个答案:

答案 0 :(得分:0)

bundle update可能会有所帮助..我看到bundle install不足以解决此类错误消息的情况很少