Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

compilation - WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.6.16

I can’t work out why I’m getting this error from Nokogiri when I start up Rails. From the little I know, it seems like something else is causing an older version of libxml2 to be loaded, which Nokogiri then ends up using, rather than the version it was compiled against.

What do I need to do to get this working without the warning (and with the right libxml2)?

I’m running this on a Macbook with OS X 10.5.8:

$ rake db:create
(in /Users/gareth/Sites/Rails3/ngtest)
WARNING: Nokogiri was built against LibXML version 2.7.7, but has dynamically loaded 2.6.16
HI.  You're using libxml2 version 2.6.16 which is over 4 years old and has
plenty of bugs.  We suggest that for maximum HTML/XML parsing pleasure, you
upgrade your version of libxml2 and re-install nokogiri.  If you like using
libxml2 version 2.6.16, but don't like this warning, please define the constant
I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring nokogiri.

ngtest_test already exists
ngtest_development already exists

$ DYLD_PRINT_LIBRARIES=1 rake db:create
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/libruby.1.9.1.dylib
dyld: loaded: /usr/lib/libSystem.B.dylib
dyld: loaded: /usr/lib/libobjc.A.dylib
dyld: loaded: /usr/lib/libgcc_s.1.dylib
dyld: loaded: /usr/lib/system/libmathCommon.A.dylib
dyld: loaded: /usr/lib/libauto.dylib
dyld: loaded: /usr/lib/libstdc++.6.dylib
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/encdb.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/trans/transdb.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/etc.bundle
(in /Users/gareth/Sites/Rails3/ngtest)
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/stringio.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/syck.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/digest/sha1.bundle
dyld: loaded: /usr/lib/libcrypto.0.9.7.dylib
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/digest.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/iso_8859_1.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/zlib.bundle
dyld: loaded: /usr/lib/libz.1.dylib
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/strscan.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/bigdecimal.bundle
dyld: loaded: /Users/gareth/.rvm/gems/ruby-1.9.2-p136/gems/mysql-2.8.1/lib/mysql_api.bundle
dyld: loaded: /usr/local/Cellar/mysql/5.1.54/lib/mysql/libmysqlclient.16.dylib
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/openssl.bundle
dyld: loaded: /usr/lib/libssl.0.9.7.dylib
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/fcntl.bundle
dyld: loaded: /Users/gareth/.rvm/gems/ruby-1.9.2-p136/gems/eventmachine-0.12.10/lib/rubyeventmachine.bundle
dyld: loaded: /Users/gareth/.rvm/gems/ruby-1.9.2-p136/gems/thin-1.2.7/lib/thin_parser.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/digest/md5.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/iconv.bundle
dyld: loaded: /usr/lib/libiconv.2.dylib
dyld: loaded: /Users/gareth/.rvm/gems/ruby-1.9.2-p136/gems/json-1.4.6/ext/json/ext/json/ext/parser.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/utf_16be.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/utf_16le.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/utf_32be.bundle
dyld: loaded: /Users/gareth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/i386-darwin9.8.0/enc/utf_32le.bundle
dyld: loaded: /Users/gareth/.rvm/gems/ruby-1.9.2-p136/gems/json-1.4.6/ext/json/ext/json/ext/generator.bundle
dyld: loaded: /Users/gareth/.rvm/gems/ruby-1.9.2-p136/gems/rpeg-markdown-1.4.6/lib/peg_markdown.bundle
dyld: loaded: /usr/local/Cellar/glib/2.24.2/lib/libglib-2.0.0.dylib
dyld: loaded: /usr/local/Cellar/gettext/0.17/lib/libintl.8.dylib
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
dyld: loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
dyld: loaded: /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
dyld: loaded: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
dyld: loaded: /usr/lib/libicucore.A.dylib
dyld: loaded: /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
dyld: loaded: /usr/lib/libbsm.dylib
dyld: loaded: /System/Library/Frameworks/Security.framework/Versions/A/Security
dyld: loaded: /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
dyld: loaded: /usr/lib/libsqlite3.0.dylib
dyld: loaded: /usr/lib/libresolv.9.dylib
dyld: loaded: /usr/lib/libxml2.2.dylib
dyld: loaded: /usr/lib/libxslt.1.dylib
dyld: loaded: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
dyld: loaded: /usr/lib/libcups.2.dylib
dyld: loaded: /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
dyld: loaded: /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
dyld: loaded: /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
dyld: loaded: /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
dyld: loaded: /usr/lib/libffi.dylib
dyld: loaded: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
dyld: loade

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In the end I had to install the gem against the specific versions of xml2 and xslt I have installed:

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
#. scrollbar line, so the code can be seen

The problem was most likely bad library management, switching between package managers without being tidy enough about it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...