Rails generator不兼容的库

问题描述 投票:10回答:7

我正在尝试将devise安装到我的Rails应用程序中,但我得到的只是此错误消息

rails g devise:install
/Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/debug_inspector-0.0.2/lib/debug_inspector.rb:6:in `require': incompatible library version - /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle (fatal)
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/debug_inspector-0.0.2/lib/debug_inspector.rb:6:in `<top (required)>'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/binding_of_caller-0.7.2/lib/binding_of_caller/mri2.rb:1:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/binding_of_caller-0.7.2/lib/binding_of_caller/mri2.rb:1:in `<top (required)>'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/binding_of_caller-0.7.2/lib/binding_of_caller.rb:9:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/binding_of_caller-0.7.2/lib/binding_of_caller.rb:9:in `<top (required)>'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/web-console-2.2.1/lib/web_console.rb:1:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/web-console-2.2.1/lib/web_console.rb:1:in `<top (required)>'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/web-console-2.2.1/lib/web-console.rb:1:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/web-console-2.2.1/lib/web-console.rb:1:in `<top (required)>'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3@global/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
    from /Users/luketimothy/Work/Arbitrage/config/application.rb:7:in `<top (required)>'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application.rb:82:in `require'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application.rb:82:in `preload'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application.rb:143:in `serve'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application.rb:131:in `block in run'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application.rb:125:in `loop'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application.rb:125:in `run'
    from /Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/spring-1.6.0/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/luketimothy/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/luketimothy/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'

我曾尝试搜索,但由于操作不同,遇到许多类似的错误。对于这个问题,没有什么特别有用的。有没有比Ruby更熟练的人可以帮助我?我通常更像是一个Python家伙...

编辑

Gemfile.lock] >>

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.2.5)
      actionpack (= 4.2.5)
      actionview (= 4.2.5)
      activejob (= 4.2.5)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.5)
      actionview (= 4.2.5)
      activesupport (= 4.2.5)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.5)
      activesupport (= 4.2.5)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (4.2.5)
      activesupport (= 4.2.5)
      globalid (>= 0.3.0)
    activemodel (4.2.5)
      activesupport (= 4.2.5)
      builder (~> 3.1)
    activerecord (4.2.5)
      activemodel (= 4.2.5)
      activesupport (= 4.2.5)
      arel (~> 6.0)
    activesupport (4.2.5)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    autoprefixer-rails (6.3.1)
      execjs
      json
    bcrypt (3.1.10)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    bootstrap-sass (3.3.6)
      autoprefixer-rails (>= 5.2.1)
      sass (>= 3.3.4)
    builder (3.2.2)
    byebug (8.2.1)
    coffee-rails (4.1.0)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.0)
    debug_inspector (0.0.2)
    devise (3.5.3)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      responders
      thread_safe (~> 0.1)
      warden (~> 1.2.3)
    erubis (2.7.0)
    execjs (2.6.0)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    jbuilder (2.3.2)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (4.0.5)
      rails-dom-testing (~> 1.0)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (1.8.3)
    kgio (2.10.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.3)
      mime-types (>= 1.16, < 3)
    mime-types (2.99)
    mini_portile2 (2.0.0)
    minitest (5.8.3)
    multi_json (1.11.2)
    nokogiri (1.6.7.1)
      mini_portile2 (~> 2.0.0.rc2)
    orm_adapter (0.5.0)
    pg (0.18.4)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.5)
      actionmailer (= 4.2.5)
      actionpack (= 4.2.5)
      actionview (= 4.2.5)
      activejob (= 4.2.5)
      activemodel (= 4.2.5)
      activerecord (= 4.2.5)
      activesupport (= 4.2.5)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.5)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.2)
      loofah (~> 2.0)
    railties (4.2.5)
      actionpack (= 4.2.5)
      activesupport (= 4.2.5)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    raindrops (0.15.0)
    rake (10.5.0)
    rdoc (4.2.0)
    responders (2.1.1)
      railties (>= 4.2.0, < 5.1)
    sass (3.4.20)
    sass-rails (5.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    spring (1.6.0)
    sprockets (3.5.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.0)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.1)
    turbolinks (2.5.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.7.2)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    unicorn (5.0.1)
      kgio (~> 2.6)
      rack
      raindrops (~> 0.7)
    warden (1.2.4)
      rack (>= 1.0)
    web-console (2.2.1)
      activemodel (>= 4.0)
      binding_of_caller (>= 0.7.2)
      railties (>= 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  bootstrap-sass
  byebug
  coffee-rails (~> 4.1.0)
  devise
  jbuilder (~> 2.0)
  jquery-rails
  pg (~> 0.15)
  rails (= 4.2.5)
  sass-rails (~> 5.0)
  sdoc (~> 0.4.0)
  spring
  turbolinks
  uglifier (>= 1.3.0)
  unicorn
  web-console (~> 2.0)

BUNDLED WITH
   1.11.2

编辑2

我想到可能正在使用OSX。还可能需要注意的是,这是DigitalOcean默认的Rails应用程序,该应用程序已加载了其Nginx + Rails图像。我将项目复制到服务器上的git repo中,然后将其克隆到本地计算机上。

我正在尝试将devise安装到我的Rails应用程序,但是我得到的只是此错误消息rails g devise:安装/Users/luketimothy/.rvm/gems/ruby-2.2.3/gems/debug_inspector-0.0.2 / lib / debug_inspector ....

ruby-on-rails ruby devise rubygems bundler
7个回答
11
投票

尝试一下。


6
投票

对您的红宝石和宝石进行全新安装


3
投票

问题与设计无关。我发现了一个类似的问题here,该问题表示要卸载存在库不兼容问题的gem,然后重新运行捆绑软件安装。所以我做到了,而且有效!


1
投票

Gemfile中,尝试将gem 'devise'行移至下方


1
投票

您是否尝试过升级devise gem的版本bundle update devise


1
投票

从头开始项目,因为在OSX下无法安装Ubuntu Rails。参见例如http://railsapps.github.io/installrubyonrails-mac.html


1
投票

尝试这个=> gem update --system

© www.soinside.com 2019 - 2024. All rights reserved.