LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-30-2011, 11:29 AM   #1
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Ruby-FFI: `ffi_libraries': no library specified (LoadError)


Hi,

As I mentioned in the subject, I got the following error when start tyrantmanager:
Code:
tyrantmanager --help

/usr/lib64/ruby/gems/1.8/gems/loquacious-1.6.4/lib/loquacious/undefined.rb:87: warning: parenthesize argument(s) for future version
/usr/lib64/ruby/gems/1.8/gems/ffi-1.0.0/lib/ffi/library.rb:93:in ffi_libraries': no library specified (LoadError)
from /usr/lib64/ruby/gems/1.8/gems/ffi-1.0.0/lib/ffi/library.rb:129:inattfunc'
from /usr/lib64/ruby/gems/1.8/gems/rufus-tokyo-1.0.7/lib/rufus/tokyo/tyrant/lib.rb:59
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib64/ruby/gems/1.8/gems/rufus-tokyo-1.0.7/lib/rufus/tokyo/tyrant.rb:32
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib64/ruby/gems/1.8/gems/tyrantmanager-1.6.0/lib/tyrant_manager/tyrant_instance.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib64/ruby/gems/1.8/gems/tyrantmanager-1.6.0/lib/tyrant_manager.rb:249
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /usr/lib64/ruby/gems/1.8/gems/tyrantmanager-1.6.0/bin/tyrantmanager:9
from /usr/bin/tyrantmanager:19:in `load'
from /usr/bin/tyrantmanager:19
It happens with all the versions of ffi: form 0.6.3 to 1.0.7.

The content of library.rb:
Code:
    21	module FFI
    22	  CURRENT_PROCESS = USE_THIS_PROCESS_AS_LIBRARY = Object.new
    23	
    24	  def self.map_library_name(lib)
    25	    # Mangle the library name to reflect the native library naming conventions
    26	    lib = lib.to_s unless lib.kind_of?(String)
    27	    lib = Library::LIBC if lib == 'c'
    28	
    29	    if lib && File.basename(lib) == lib
    30	      lib = Platform::LIBPREFIX + lib unless lib =~ /^#{Platform::LIBPREFIX}/
    31	      r = Platform::IS_LINUX ? "\\.so($|\\.[1234567890]+)" : "\\.#{Platform::LIBSUFFIX}$"
    32	      lib += ".#{Platform::LIBSUFFIX}" unless lib =~ /#{r}/
    33	    end
    34	
    35	    lib
    36	  end
    37	
    38	  class NotFoundError < LoadError
    39	    def initialize(function, *libraries)
    40	      super("Function '#{function}' not found in [#{libraries[0].nil? ? 'current process' : libraries.join(", ")}]")
    41	    end
    42	  end
    43	
    44	  module Library
    45	    CURRENT_PROCESS = FFI::CURRENT_PROCESS
    46	    LIBC = FFI::Platform::LIBC
    47	
    48	    def self.extended(mod)
    49	      raise RuntimeError.new("must only be extended by module") unless mod.kind_of?(Module)
    50	    end
    51	
    52	    def ffi_lib(*names)
    53	      lib_flags = defined?(@ffi_lib_flags) ? @ffi_lib_flags : FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_LOCAL
    54	      ffi_libs = names.map do |name|
    55	
    56	        if name == FFI::CURRENT_PROCESS
    57	          FFI::DynamicLibrary.open(nil, FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_LOCAL)
    58	
    59	        else
    60	          libnames = (name.is_a?(::Array) ? name : [ name ]).map { |n| [ n, FFI.map_library_name(n) ].uniq }.flatten.compact
    61	          lib = nil
    62	          errors = {}
    63	
    64	          libnames.each do |libname|
    65	            begin
    66	              lib = FFI::DynamicLibrary.open(libname, lib_flags)
    67	              break if lib
    68	
    69	            rescue Exception => ex
    70	              errors[libname] = ex
    71	            end
    72	          end
    73	
    74	          if lib.nil?
    75	            raise LoadError.new(errors.values.join('. '))
    76	          end
    77	
    78	          # return the found lib
    79	          lib
    80	        end
    81	      end
    82	
    83	      @ffi_libs = ffi_libs
    84	    end
    85	
    86	
    87	    def ffi_convention(convention)
    88	      @ffi_convention = convention
    89	    end
    90	
    91	
    92	    def ffi_libraries
    93	      raise LoadError.new("no library specified") if !defined?(@ffi_libs) || @ffi_libs.empty?
    94	      @ffi_libs
    95	    end
Code:
# gem list

*** LOCAL GEMS ***

arrayfields (4.7.4)
fattr (2.2.0)
ffi (1.0.0, 0.6.3)
little-plugger (1.1.2)
logging (1.4.3)
loquacious (1.6.4)
main (4.4.0, 4.2.0)
rake (0.8.7)
rufus-tokyo (1.0.7)
tyrantmanager (1.6.0)
Can anyone help me fix this problem?
 
Old 04-30-2011, 04:25 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Is libffi installed ? ?

# yum install libffi
If CentOS5 : The Karanbir repo, or
http://rpm.pbone.net/index.php3/stat....i386.rpm.html

Debian : libffi5

Source http://sources.redhat.com/libffi/

..
 
Old 04-30-2011, 09:31 PM   #3
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Original Poster
Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by knudfl View Post
Is libffi installed ? ?

# yum install libffi
If CentOS5 : The Karanbir repo, or
http://rpm.pbone.net/index.php3/stat....i386.rpm.html

Debian : libffi5

Source http://sources.redhat.com/libffi/

..
Yes, it is:
Code:
$ rpm -qa | grep libffi
libffi-devel-3.0.9-1.el5.rf
libffi-3.0.9-1.el5.rf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any issues installing Ruby Gems and Ruby on Rails in Slackware? Lufbery Slackware 8 02-09-2011 08:22 PM
default ruby missing library, test case provided. randomsel Slackware 2 02-22-2008 11:05 AM
Ruby SDL/ Ruby OpenGL tutorials/reference? LinuxNoob75 Programming 0 12-30-2007 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration