-
Notifications
You must be signed in to change notification settings - Fork 19
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
Error when loading libraries on OSX #438
Comments
Hi, Shoes 3.3.7 provides it's own ruby 2.3.7 so that should be good. Shoes 3.3.8 is beta, at best - did you build Shoes from source? The error message suggests that Shoes needs to be more specific in versioning it's dylib. we provide 2.3.0 (dylib) for any ruby 2.3.x we use - it's the 'normal' way but appears that isn't what rmagick thinks. There are several ways Shoes could have gotten this wrong. If you're comfortable with symlinks you can look at how Shoes does it. I'll check my osx box later today. |
The gem doesn't build/install for me - probably homebrew reasons installing imagemagick. You can get better error messages by doing 'cshoes -g install rmagick` Mine seemed happy with Shoes' libruby.dylib version but it couldn't find the imagemagick .h files. Sigh. I'm on 10.11 so that may be part of the homebrew issues. For symlinks you could can cd into /Applications/Shoes/Contents/MacOS/ $ ls -ld libruby*
$ ln -s libruby.2.3.0.dylib libruby.2.3.7.dylib It might get you going. Note: Shoes with the rmagick gem is not likely to be distributeable because of the dependency on imagemagick. |
Thank you for your help, I just tried using Shoes 3.7.7 from binaries and it's the same I can install the gem without issue but get the same error message when open my app. I tried also you idea of creating symlink inside the /Applications/Shoes/Contents/MacOS/ but again same result. But I'm not sure to understand why dlopen load |
That is a good clue. It should not be opening from Frameworks. That suggest's that some library that |
It seems brew and imagemagick are known to be 'hard' to get correct. . Which version of imagemagick did you install, @girardof ? I'm running osx 10.13.6 and ImageMagick 7.0.8-40 seems to hit the problem in the linked issue. UPDATE - after UPDATE 2 - ah.. the gem install was done (by Shoes) in my rvm area (rbenv for you), not in ~/.shoes/+gem/ - that is wrong - Shoes should be insulated from any installed rubies. UPDATE 3 - manual->furthermore->sample->simple->info shoes that rvm is bleeding into the Shoes ext/gem paths. |
Sigh... It seems this has been broken for a long time on OSX. I don't need it to build shoes so it never got good testing in the last couple of years. Basically, rubygems has a built-in love for finding ruby in homebrew or system frameworks. Shoes doesn't help by bleeding rvm info so that it seems to install gems properly but can't load them. I got the bleeding to stop by adding this hack to the end of lib/shoes/cache.rb if ENV['GEM_HOME']
$stderr.puts "Killing rvm in paths"
$:.each do |p|
if p =~ /(\.rvm)|(\.rbenv)/
$:.delete(p)
end
end
end Now we get useful information about whats not working from a UPDATE: rmagick's extconf.rb has some blame here. It's making assumptions Shoes may not be able to meet. |
Thank you very much for your time and your answers. For ImageMagic I am also using the version 6, let me know if I can do something for you concerning this issue. |
@girardof Did you build Shoes from source? If so, there are several workarounds to explore: You can point the Ruby and GemLoc fields to point to your rbenv ruby and it will copy those into Shoes at build. That still may not be good enough for rmagick gem but who knows. Ideally, you could build a 'minosx' target but that's broken (but fixable and untested). Or you can try a Jail Break. . I have my doubts with rmagick and jailbreak. UPDATE: Jailbreak doesn't work with rmagick gem. Building from source with the latest commits does allow building Shoes with rvm/rbenv ruby and all gems in that ruby. Will only work of the builder's system (imagemagick and homebrew issues) |
* can build 'osx' target using rvm and it's gems - unique situations only
It's now complex enough to move this issue to Shoes 3.3.8 - no completion date - Sorry. The only way to get the rmagick gem working with Shoes 3..3.7 is to build your own Shoes from source and make sure that ruby and homebrew build for the same arch - x86_64-darwin17 for me on osx 10.13.6. @girardof probably has x86_64-darwin18 . BUT shoes as I distribute it, is actually for osx 10.10 (aka x86_64-darwin13) . Getting Shoes (binary download) to build gems for darwin13 is a deep dive into gem internals. |
@girardof I've got a OSX Shoes 3.3.8 beta with the rmagick gem inside. Download. The gem should work for you since your brew probably installed the imagemagick dylibs the same place my homebrew did. FWIW, you don't have to replace the Shoes in /Applications to test it. Just drag it somewhere else and create a |
@ccoupe That's great, thank you for your hard work. |
* osx: './cshoes -g install rmagick' works. or 'bluecloth' Cobbler and Shoes.setup - not yet. * create some targets for 64 bit Ruby Windows building. Experiment.
I managed to get some things working properly for shoes 3.3.8.
These are not trivial things. Note: an Xcode update will wipe out old SDK's so use symlinks in /Apllications/xCode..../ . The Cobbler/Shoes.setup() GUI code needs updating but that seems doable. |
Getting the rmagick gem to load is one thing. Getting it to work is something else. Shoes has a real problem here. I believe it depends on how the ruby inside Shoes is built - currently libruby.xxx.dylib is built to use @executable_path for loading. All gems are built with that assumption. That assumption won't work for the other dylibs Imagemagick wants (homebrew has absolute paths which should work, in theory - but don't in practice. I did have Shoes built with a ruby from homebrew and that rmagick gem did run a tiny test. Of course the display method won't work unless you have X11 installed and I don't. I've can't think of a way this gem would work with a downloaded Shoes. Still pondering what can be done but I'm not hopeful. The rmagick gem uses the old memory management macros that stopped working in Ruby 2.4 - it compiles but beware, segfaults will occur unless rmagick doesn't let ruby manage the gc for it's objects. Either way, it's trouble and I've got other things to fix. |
it's easy for the gem (rmagick in partular) to not work. It's an OSX and ruby thing. Shoes only looks like ruby.
I'm having what may be the same problem with the I'm running Shoes 3.3.7 downloaded from http://shoesrb.com/downloads/. I'm running on a macOS 10.14.5 box. I have Homebrew installed, and a Homebrewed My Shoes app attempts to depend on
When I run my app, I can see the progress meter for it fetching and building hpricot. But after that happens, I get this error:
That looks like the same issue OP encountered with rmagick? I download the Shoes 3.3.8 beta (build 3.3.8 r3350), deleted my I think I can work around this by migrating my app to Nokogiri, but I hear that's hard to build correctly, too. UPDATE: Nokogiri installed just fine. That's a workaround for me. |
Hpricot is very very old. Shoes used to include it but now we include nokogiri - you wont have to build it. We also include activesupport so you shouldn't need or try to replace it - them manual uses it, indirectly. There is no need for Shoes.setup for built in gems like nokogiri and activesupport and some danger that they will attempt to install later versions which if built (big if) might confuse Shoes or us as to which to use. |
Using the built-in nokogiri and activesupport seems to work fine. Thanks! Is there somewhere with a list of all the gems that come built in to each Shoes version? |
As mentioned else where, |
Hello everyone,
I've been using for the past few days and so far everything is great. Recently I tried to integrate rmagick inside a Shoes app, I was able to install it using
cshoes -c
but when I try to open my app I get the following message :From what I understand rmagick need to use ruby v2.3.3 or more and Shoes is using 2.3.0 in my case. Is it be possible to specify the ruby version to use when opening my project ?
I'm currently on OSX V10.14.3 using Shoes 3.3.8 r3276 and rbenv.
Thank for your help and your work on Shoes.
Florian.
The text was updated successfully, but these errors were encountered: