【问题标题】:undefined method 'inline' for ImageScience:Class (NoMethodError)ImageScience:Class (NoMethodError) 的未定义方法“内联”
【发布时间】:2011-05-04 11:00:28
【问题描述】:

我正在将 Rails 2.1.2 应用程序迁移到 Rails 2.3.11

为了让我的生活更轻松,我使用了 bundler,但在启动服务器时出现以下错误:

/Library/Ruby/Gems/1.8/gems/image_science-1.2.1/lib/image_science.rb:90: undefined method `inline' for ImageScience:Class (NoMethodError)
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
        from ./script/../config/boot.rb:113:in `load_gems'
        from /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:164:in `process'
        from /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in `send'
        from /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in `run'
        from /Users/michaelkoper/code/beruby_git/config/environment.rb:18
        from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require'
        from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require'
        from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require'
        from /Library/Ruby/Gems/1.8/gems/rails-2.3.11/lib/commands/server.rb:84
        from script/server:3:in `require'
        from script/server:3

这有点奇怪,因为我在没有捆绑程序的情况下也能正常工作。我想我缺少 gem 依赖项。

宝石文件:

    gem 'mperham-deadlock_retry', :require => 'deadlock_retry'
    gem 'hoptoad_notifier', '2.4.2'
    gem 'will_paginate', '~> 2.3.15'
    gem "activemerchant", :require => "active_merchant"
    gem "newrelic_rpm"
    gem 'calendar_date_select'
    gem 'ckeditor', '3.4.3'     gem 'automatic_foreign_key'
    gem 'chronic'
    gem 'mechanize'
    gem 'rexml-expansion-fix'
    gem 'image_science', '1.2.1'
    gem 'inline', '0.1.0'

捆绑安装:

    Using rake (0.8.7) 
    Using activesupport (2.3.11) 
    Using rack (1.1.2) 
    Using actionpack (2.3.11) 
    Using actionmailer (2.3.11) 
    Using builder (3.0.0) 
    Using braintree (2.10.0) 
    Using activemerchant (1.14.0) 
    Using activerecord (2.3.11) 
    Using activeresource (2.3.11) 
    Using redhillonrails_core (1.1.3) 
    Using automatic_foreign_key (1.2.0) 
    Using calendar_date_select (1.16.2) 
    Using cgi_multipart_eof_fix (2.5.0) 
    Using hoe (2.8.0) 
    Using chronic (0.2.3) 
    Using mime-types (1.16) 
    Using ckeditor (3.4.3) 
    Using columnize (0.3.2) 
    Using daemons (1.0.10) 
    Using fastthread (1.0.7) 
    Using gem_plugin (0.2.3) 
    Using highline (1.6.1) 
    Using hoptoad_notifier (2.4.2) 
    Using image_science (1.2.1) 
    Using inline (0.1.0) 
    Using linecache (0.43) 
    Using nokogiri (1.4.4) 
    Using mechanize (0.9.3) 
    Using mongrel (1.1.5) 
    Using mperham-deadlock_retry (1.0.0) 
    Using mysql (2.8.1) 
    Using newrelic_rpm (2.14.1) 
    Using rails (2.3.11) 
    Using rexml-expansion-fix (1.0.1) 
    Using ruby-debug-base (0.10.4) 
    Using ruby-debug (0.10.4) 
    Using will_paginate (2.3.15) 
    Using bundler (1.0.7) 

【问题讨论】:

  • ImageScience 是您自己的模型之一,还是其他库/gem 等的依赖项?
  • @Tyran East,ImageScience 不是我创建的模型
  • 好的,我“解决了”它。我从 gem 规范中删除了内联,并将图像科学更改为 1.1.3 版。这不是解决方案,所以我让这个问题保持活力。好想用最新的版本....

标签: ruby-on-rails ruby rubygems bundler image-science


【解决方案1】:

实际上,您可能想要这个答案:ImageScience breaks on update to Rails 3

【讨论】:

  • image_science 确实有 RubyInline 和 hoe(1.2.1) 作为依赖项。但我不认为 hack 会解决它......而且我不想在任何地方都需要 image_science,因为我经常使用它......无论如何我都会尝试一下
  • 您是否只需将“inline”行放在 Gemfile 中的“image_science”行之前?我实际上不知道 Gemfile 排序是否重要……但它可能值得一试。
猜你喜欢
  • 1970-01-01
  • 2013-04-24
  • 2015-05-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-09
  • 2014-12-01
  • 2019-06-12
相关资源
最近更新 更多