-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gem Load Error is: wrong constant name 3D #1124
Comments
Can you show your Poppler (not poppler gem) version? |
@kou hey sure, it's Poppler 0.62.0 installed on OSX by homebrew. |
Thanks. diff --git a/poppler/lib/poppler/loader.rb b/poppler/lib/poppler/loader.rb
index d7ded8625..ed91b9398 100644
--- a/poppler/lib/poppler/loader.rb
+++ b/poppler/lib/poppler/loader.rb
@@ -43,6 +43,7 @@ module Poppler
end
def load_enum_info(info)
+ p [info.name, info.values.collect(&:name)]
case info.name
when "AnnotType"
self.class.register_constant_rename_map("3D", "TYPE_3D") |
Even i'm facing the same issue. Unable to start Rails server unless i comment out poppler and cairo-gobject in Gemfile. |
Can you show your environment? |
@kou sorry for the delay, small typo in your command Anyway, here's the output you're after:
|
Can you fix the warning?
You may need to add |
poppler was installed using homebrew, the path to that file is:
What is |
I'm not a macOS user. Can you look into it? |
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
(null)-WARNING **: Failed to load shared library '@rpath/libpoppler-glib.8.dylib' referenced by the typelib: dlopen(@rpath/libpoppler-glib.8.dylib, 9): image not found
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:629:in `load_union_info'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:74:in `load_info'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:43:in `block in load'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:34:in `block (2 levels) in each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:33:in `times'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:33:in `block in each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:32:in `each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:32:in `each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:42:in `load'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/poppler-3.2.1/lib/poppler.rb:35:in `<module:Poppler>'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/poppler-3.2.1/lib/poppler.rb:30:in `<top (required)>'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'
/Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:162:in `const_set': wrong constant name 3D (NameError)
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:162:in `load_enum_value'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:187:in `block in load_enum_info'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:186:in `each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:186:in `load_enum_info'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/poppler-3.2.1/lib/poppler/loader.rb:57:in `load_enum_info'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:66:in `load_info'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:43:in `block in load'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:34:in `block (2 levels) in each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:33:in `times'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:33:in `block in each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:32:in `each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/repository.rb:32:in `each'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/gobject-introspection-3.2.1/lib/gobject-introspection/loader.rb:42:in `load'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/poppler-3.2.1/lib/poppler.rb:35:in `<module:Poppler>'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/poppler-3.2.1/lib/poppler.rb:30:in `<top (required)>'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from /Users/BigBoss/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'``` |
I think that it's a problem of Homebrew. Can you report it to Homebrew? The output of the followings may help Homebrew developers: % ruby -r fiddle -e 'p Fiddle.dlopen("libpoppler.dylib")'
% DYLD_LIBRARY_PATH=/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/:$(brew --prefix)/lib ruby -r fiddle -e 'p Fiddle.dlopen("libpoppler.dylib")' |
@kou that command you wrote there works great:
|
What about this? % ruby -r fiddle -e 'p Fiddle.dlopen("libpoppler-glib.dylib")' Again, I'm not a macOS user. We need your help. Can you try to look into this problem? |
Yea honestly I'm not sure what I'm meant to be looking for.
|
works too |
% ruby -r fiddle -e 'p Fiddle.dlopen("@rpath/libpoppler-glib.8.dylib")'
% strings $(brew --prefix)/lib/girepository-1.0/*.typelib | grep dylib |
|
@meetajhu Great! |
@ollym It seems that Poppler's typelib file only uses |
This poppler formula change will help you. This change resolves diff --git a/Formula/poppler.rb b/Formula/poppler.rb
index 1b446ea0fa..42b3cc53e0 100644
--- a/Formula/poppler.rb
+++ b/Formula/poppler.rb
@@ -68,6 +68,18 @@ class Poppler < Formula
end
system "cmake", ".", *args
+ system "make"
+ Dir.glob("glib/*.gir") do |gir_path|
+ gir_content = File.read(gir_path).gsub(/(shared-library=".+?")/) do
+ $1.gsub(/@rpath/) {lib}
+ end
+ File.open(gir_path, "w") do |gir_file|
+ gir_file.print(gir_content)
+ end
+ end
+ Dir.glob("glib/*.typelib") do |typelib_path|
+ rm_f(typelib_path)
+ end
system "make", "install"
resource("font-data").stage do
system "make", "install", "prefix=#{prefix}" |
Generally speaking, Homebrew won't accept patches without upstream feedback. |
Workaround: % DYLD_LIBRARY_PATH=$(brew --prefix poppler)/lib ruby ... Anyway, we should work together to fix the problem on Homebrew and Poppler. |
This has been solved in the latest Homebrew and Poppler. |
Ruby 2.4.1
this is using the poppler gem 3.2.1
The text was updated successfully, but these errors were encountered: