ImageScience interrupts upgrade to Rails 3

I had a working (and workable) ImageScience install, which made some simple resizing for different image sizes, and then copied them to different directories. Everything is very simple. This small and simple routine was in a rake. When upgrading to Rails 3, this rake task will still work (it also does some AR inserts and audio encoding), but image_science needs to fail with this message,

"crash required at /home//.ruby_inline/Inline_ImageScience_cdab.so"

I ruled out installing Duff ImageScience, as I can go to IRB and make some simple calls to ImageScience and make sketches. The rest of the rake task works just as well as before if I comment on any mention of the "image_science" requirement or the ImageScience routine.

output from a rake at failure,

/var/lib/gems/1.8/gems/RubyInline-3.8.6/lib/inline.rb:513:in `load'
/var/lib/gems/1.8/gems/RubyInline-3.8.6/lib/inline.rb:829:in `inline'
/var/lib/gems/1.8/gems/image_science-1.2.1/lib/image_science.rb:90
...
<active_support complaints >
...
/home/<user>/RailsApps/marlow/lib/tasks/flac_import.rake:2
...
<rails complaints>
...
/home/<user>/RailsApps/marlow/Rakefile:7
...
<standard complaints to end>

Rakefile in the rails root directory is a spare and standard Rakefile Rails 3, for example,

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'

Marlow::Application.load_tasks

the last line is line 7.

I'm kind of fixated on what's breaking it, and Google doesn't seem to shed anything. Does anyone know why RubyInline is complaining? Or why is this once-working Rake task suddenly unhappy with what ImageScience is called? OS is Ubuntu 10.10, but it all worked before the Rails 3 update.

Thanks in advance

+3
4

, , , , carlhuda 431

, . require Kernel.require.

require image_science.

+2

, .

image_science :

gem 'image_science', :require => false

ruby-inline ( image_science). config/initializers/ruby_inline_hack.rb:

class Inline::C
  def load
    require "#{so_name}"
    #below is the original version which breaks
    #require "#{so_name}" or raise LoadError, "require on #{so_name} failed"
  end
end

require 'image_science', . .

+1

ismave:

, ! !

class Inline::C
  def load
    require "#{so_name}" || raise LoadError, "require on #{so_name} failed"
  end
end

||, , . "" , , , ...

0

, .

Point your gem file to https://github.com/asynchrony/image_science We restored image science without a ruby ​​built-in interface.

0
source

Source: https://habr.com/ru/post/1776967/


All Articles