dyld: Library not loaded: /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib
Referenced from: /opt/local/bin/identify
Reason: image not found
Does anyone have a solution? Would upgrading Xcode to 4.1 help?
I'd recommend installing the latest XCode, 4.1, from the App Store before you do anything else, so as to get the latest build tools and dev libraries.
You'll likely need to recompile any Gems with native bindings (which it looks like you have, since something is looking for OpenCL, likely not RSPec itself).
To recompile all your gems run:
gem pristine --all
dydl errors are commonly associated with database drivers/bindings. Try re-installing your database if neither of the above work.
Your /opt/local/bin/identify is probably ImageMagick’s identify.
You probably need to rebuild your installation of ImageMagick. Based on the pathname (/opt/local/), you probably installed it as a part of MacPorts.
You should probably follow the instructions for Migrating a MacPorts install to a new major OS version or CPU architecture: install new Xcode, install latest MacPorts base, record installed ports, remove ports, reinstall ports.
Unfortunately, MacPorts’ bug #30322 indicates that the ImageMagick port may not yet build properly under Lion (found via MacPorts’ Lion Problems page).
I had a problem similar to this after a clean install of Lion, with Xcode 4.1 installed (both from the Mac App Store).
What eventually fixed it was running sudo gem install rspec -v 2.6.0. The actual problem (for me, your mileage may vary) was that the script stub wasn't being installed in /usr/bin, which meant the OS couldn't find RSpec without a full path spec.
Related
I was running PostgreSQL 9.1, installed from Postgres (/Library/PostgreSQL/9.1) - ie not homebrew etc and on Mac OSX Leopard.
I upgraded to Snow Leopard and then immediately to Mountain Lion and had a mass of problems with gems failing to build etc, but got them fixed
Rails server crashed on startup with pg issues & I tried everything I could find but could not fix the prob - fixes included links etc, which may still persist (hence this background info might inform the solution)
I uninstalled postgresql 9.1 and installed Postgres App
Now on rake db:create I get the following:
rake aborted!
dlopen(/Users/mitch/.rvm/gems/ruby-1.9.2-p320#tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle, 9): Library not loaded: #loader_path/../lib/libpq.5.dylib
Referenced from: /Users/mitch/.rvm/gems/ruby-1.9.2-p320#tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle
Reason: no suitable image found. Did find:
/usr/local/lib/libpq.5.dylib: mach-o, but wrong architecture - /Users/mitch/.rvm/gems/ruby-1.9.2-p320#tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle
I'm running rvm (as u can see) and after the OS upgrade created a new gemset and installed Ruby
I've changed my path to reflect the advice of Postgresql App, after the OS upgrade I installed Xcode 5 and the command line tools as advised and I think my database.yaml file is ok
I suspect the problem might be connected with sym-links made earlier in the process, but I'm stuck to find the solution
Sounds like something has gone wrong in your Ruby installation. Try reinstalling Ruby Enterprise Edition via RVM:
rvm reinstall ree
I was experiencing the same issue with a different version of libpq. What I ended up doing is creating a link to the correct file:
sudo ln -s /Applications/Postgres93.app/Contents/MacOS/lib/libpq.5.6.dylib /usr/local/lib/
My previous answer was deleted as it wasn't originally an answer, just a confirmation of a similar issue. Hope this helps!
In the end I think this was tied up with the fact that Mountain Lion ships with Postgresql rather than MySQL as per previous OSX versions.
I couldn't make sense of the Postgres App, so I uninstalled it and also uninstalled the version of Postgresql that shipped with ML and then did a Homebrew install of the latest version of Postgresql (which places it in a different place than if you install it direct from the Postgresql site).
This seemed to straighten everything up
Operating System I am using is Mac OSX Mountain Lion.
First I will give some back story on how this cluster F started. I am going through a Ruby on Rails Web development book. I want to use PostgreSQL as my server. Before today I was using sqlite3. I downloaded PostgreSQL 9.1 from there website. I used the DMG installer. Once I was done with the install process it asked me to re-boot because of some sort of memory problem, I did that and it installed without error.
The problem started when I tried to use the "Rails Server" command in the terminal. This is what I got (I tried to strip out the unimportant stuff which would clutter everything up)
/Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/pg-0.12.2/lib/pg.rb:4:in `require': dlopen(/Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/pg-0.12.2/lib/pg_ext.bundle, 9): Library not loaded: /usr/lib/libcrypto.dylib (LoadError)
Referenced from: /usr/lib/libpq.5.dylib
Reason: Incompatible library version: libpq.5.dylib requires version 1.0.0 or later, but libcrypto.0.9.8.dylib provides version 0.9.8 - /Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/pg-0.12.2/lib/pg_ext.bundle
...
from /Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/commands.rb:50:in
I have read through the out put and I have done a lot of Google searching, and what I have found is that it's a problem with which version of libcrypto the server is fetching. Or something about the libssl. I have gone through the solutions on google and nothing seems to be working. Hopefully someone has had the same problem I have, and can help me.
Thanks in advance! -Chris
I really recommend you to use Homebrew to install postrgresql. It helps you to install all proper dependencies for version which correctly works with rails.
$ brew install postgresql
Do not forget to follow after install instructions from homebrew
Are you sure you installed PostgreSQL server/rubygem successfully? From the stack trace I think there's a problem about it.
If your PostgreSQL server/rubygem are working well, then switch another webserver, mongrel/thin are both OK, both have better performance than the default rails server(webrick) and easy to use.
I'm developing a Ruby 1.9.2 / Rails 3.2.2 app and recently I had to buy a mac and now I migrating all my work from Ubuntu to Lion 10.7.3
Yesterday I finally got Rails installed through a very painful process due to compilation errors of Ruby. This command solves my installation:
CC=/usr/bin/gcc-4.2 rvm install 1.9.2
During the various attempts, I had to install XCode 4.2 too and if I understand right, XCode is useless for ruby 1.9.2... isn't it?
So does anybody know if I can uninstall Xcode 4.2 without troubles ?
What you have now is the best set of tools for compiling rubies recomended by RVM.
Removing it will have few implications:
You will not be able to install new rubies
You will not be able to install new gems with native extesnions
If you want to remove Xcode 4.2 you will lose possibility for installing some software
nodejs
some gems like rb-fsevent
I wouldn't say that XCode is entirely useless for Ruby, just depends on what you're looking for. Syntax highlighting is decent, autocomplete w/o code hinting, and the repo tools are pretty solid. I've used it without too much complaint, but I tend to rotate through IDE / editor phases and keep a few flavors around. YMMV.
Aside from the IDE and SDKs, XCode provides gcc on OS X systems (which is why you installed it in the first place). There are other ways to accomplish this, but there's really no harm in having XCode lurking about and not using it.
I would upgrade to XCode 4.3 and install the CLI-Tools (compiler stuff etc.) than it should be save to remove XCode from your machine, since the compiler is separated and wont be uninstalled.
if you just remove XCode 4.2 (not the app itself but the developer tools) you wont be able to install some gems (gems with C extensions which need to be compiled) because it removes the compilers too.
lazy way: just keep how it is now :)
I have not done it, but you should be able to install GCC from here and get rid of xcode
https://github.com/kennethreitz/osx-gcc-installer
personally, I would leave xcode installed, unless drive space is an issue
If you want a safe option downgrade to XCode 4.1. Do not upgrade to XCode 4.3 or you will start having random crashes on some compiled gems.
The best option for ruby development on OS X Lion is XCode 4.1 and exporting CC=/usr/bin/gcc-4.2 in your .bashrc or .zshenv
This will allow you to compile ruby from 1.8.7 to 1.9.3 and all the gems you want.
As many people wrote, Xcode 4.3 seems to have issues, so better avoid this at least at this moment.
Additional note: Building Ruby 1.9.3 with Xcode 4.3, or clang compiler cause various problem. This is due to:
https://bugs.ruby-lang.org/issues/6080
This issue is resolved in development branch already.
I'm staying with Xcode 4.2.1, but I don't' recommend to set CC=gcc-4.2 in shell profiles. Instead, you can:
CC=gcc-4.2 ./configure
to configure, or
CC=gcc-4.2 rvm install 1.9.2
if you use RVM.
I'm on OSX Snow Leopard though I think this may not be a platform-specific issue.
The problem is I've wasted hours of my life trying to get gem install rmagick to work and I'm hoping to save the next person that grief.
I believe the core problem is summed up in the title.
Questions:
Can anyone confirm that Rmagick 2.13.1 doesn't work with ImageMagick 6.6.4?
What's the best solution to getting Rmagick installed on Snow Leopard?
Should MacPorts be used to install ImageMagick? (I couldn't figure out how to tell macports to use an old version of ImageMagick.)
And finally:
Getting ImageMagick to work at all now is giving me fits because I've tried installing various versions in various ways and they're interfering with each other.
Below are instructions for purging and reinstalling macports (is that necessary?) but I'm not sure how to clean up other libraries for doing a fresh ImageMagick install.
For example, I currently get the following error trying to run ImageMagick
dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/convert
Reason: Incompatible library version: convert requires version 11.0.0 or later,
but libfreetype.6.dylib provides version 10.0.0
Perhaps just getting rid of /usr/local/lib/libfreetype* before reinstalling suffices (I'll confirm here when I get ImageMagick working) but is there a more complete/definitive way to do a fresh install of a specific version of ImageMagick?
Appendix: Purging and reinstalling MacPorts
Purge: http://guide.macports.org/#installing.macports.uninstalling
Reinstall from scratch:
http://distfiles.macports.org/MacPorts/MacPorts-1.9.1-10.6-SnowLeopard.dmg
(as of 2010.10.09 -- check http://distfiles.macports.org/MacPorts for latest version)
Then do sudo port selfupdate just to be sure.
RMagick is an... interesting library. If at all possible, avoid it's usage. If you're just resizing images and other basic things, look at minimagick. The main issue with RMagick stems from memory usage and leaks - not usually apparent in development, but in production they get ugly fast.
My advice would be to look at alternatives if at all possible - if you have to do more complex work, it might actually be preferable to use Python/PIL for that instead (wrapped with Ruby - I use this to get at OpenCV, for example). Depends on your use case.
If you really need RMagick, then Homebrew might work better than ports. I'm a Linux guy where this stuff tends to Just Work, and over there the definitive way to get things like ImageMagick set up properly outside of package managers is to build it from source. Not sure how practical that is on OSX, but it might be worth a shot if all else fails.
I am also stuck trying to install an earlier version of ImageMagick, but I'm trying to do it via Homebrew. Along the way, however, I discovered how to install older packages via MacPorts, and it did work for me (although I had to ditch MacPorts for other reasons).
Instructions for moving to an older port version are here:
https://trac.macports.org/wiki/howto/InstallingOlderPort
Fundamentally, the answer indeed seems to be that you need an older version of ImageMagick for Rmagick to work (at least under Snow Leopard).
I've confirmed that ImageMagick 6.5.6-10 works with Rmagick 2.13.1.
(Rmagick homepage says it's been tested up through ImageMagick 6.6.1-0. Version 6.6.1-0 doesn't seem to be available but probably 6.6.1-10, which is available, is fine too.)
All the troubles with MacPorts were probably mostly red herrings. Still, MacPorts does not seem to have a way to install a previous version of ImageMagick so I installed it from source.
HomeBrew might be a better option.
The errors I was getting with ImageMagick were solved for me by removing /usr/local/lib/libfreetype* and reinstalling ImageMagick.
I also purged and reinstalled MacPorts but I don't know that that was necessary.
Here are the exact steps I took to get this working, as best as I can reconstruct them.
Purge and reinstall MacPorts (see appendix of the question above).
Remove /usr/local/lib/libfreetype*
sudo port -v install freetype +bytecode
sudo port -v install librsvg
I didn't do this but some people might want: sudo port -v install graphviz +gs +wmf +jbig +jpeg2 +lcms
cd /usr/local/src
curl 'ftp://ftp.imagemagick.org/pub/ImageMagick/legacy/ImageMagick-6.5.6-10.tar.gz' > ImageMagick-6.5.6-10.tar.gz (This will probably work too: ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.1-10.tar.gz)
tar xzvf ImageMagick-6.5.6-10.tar.gz
cd into there but don't follow the instructions in Install-whatever.txt because they're all messed up.
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install
gem install rmagick
Phew! Note that steps 3-14 could probably be replaced with this: http://github.com/masterkain/ImageMagick-sl
I've got an app developed on Ruby 1.8.6 and frozen to use Rails 2.0.2 that hits problem after problem on Snow Leopard:
-Default Snow Leopard Ruby 1.8.7 64-bit and 32-bit running Rails 2.0.2
-rake tasks not seeing ZenTest
-openssl header mismatches while compiling 32-bit Ruby 1.8.6 from source
-image_science apparently requiring Xcode Dev Tools 10.4
-MacPorts installing 64-bit code by default (obviously)
I think I've resigned to the idea of needing Ruby 1.8.6 32-bit, but it seems to keep conflicting with underlying 64-bit system C libraries in Snow Leopard. Any tips before I throw up my hands and revert to Leopard?
Kimball
Unpack ruby-enterprise-1.8.6-20090610 somewhere and install it with:
$ ./installer --auto=~/ree186 --configure-arg 'ARCH_FLAG="-arch i386"'
Double-check your installed ruby with:
$ file ./ree186/bin/ruby
./ree186/bin/ruby: Mach-O executable i386
A problem I had while double-checking that this worked is that RVM had changed my gem home to something the installer hadn't expected. Just something to look for if you've been playing around with various methods of installing multiple versions of ruby. Outside special cases like this one, it works quite well.
As for ImageMagick, if you use macports, make sure you install it using the 'universal' variant:
$ sudo port install ImageMagick +universal
Actually, it will be significantly less pain in general if you just deal with the increased compile times and install everything universal in macports. Create a file at /opt/local/etc/macports/variants.conf containing '+universal' and any other variant flag defaults you want to set up. Open /opt/local/etc/macports/macports.conf and make sure 'universal_archs' is set to 'x86_64 i386'. After setting this up, make sure you install everything that you need via macports to avoid additional headaches.
There are also plenty of reasons to attempt an upgrade of rails to 2.3.4 if the level of complexity and test coverage are sane.
Have you tried a separate install of Ruby 1.8.6 independent of the Snow Leopard install? You can take a look at ruby_switcher.sh if you want to be able to switch back and forth easily. It's also great for testing Ruby 1.9.