Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-04-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
Using IceRuby 3.2.1 on OSX

I was able to successfully compile IceRuby 3.2.1 using the Ice for OSX binary (with some help from the following:
Quote:
Note that I simply copied Make.rules.Darwin over from the source [C++] package into my Ice's config directory and all worked great.
)

However, I cannot get Ruby to recognize IceRuby. I followed the directions for Linux by doing (and yes, I substituted /opt/IceRuby-3.2.1/ for where I really have it installed):
Quote:
Using Ice for Ruby
------------------

The Ruby interpreter must be able to locate the Ice extension. One way
to configure the interpreter is to define the RUBYLIB environment
variable as follows:

$ export RUBYLIB=/opt/IceRuby-3.2.1/ruby:$RUBYLIB

This example assumes that your Ice for Ruby installation is located in
the /opt/IceRuby-3.2.1 directory.

In addition, you must modify your PATH environment variable to include
the directory /opt/IceRuby-3.2.1/bin as shown below:

$ export PATH=/opt/IceRuby-3.2.1/bin:$PATH

You must also modify LD_LIBRARY_PATH to include the directory
/opt/IceRuby-3.2.1/lib:

$ export LD_LIBRARY_PATH=/opt/IceRuby-3.2.1/lib:LD_LIBRARY_PATH

To verify that Ruby can load the Ice extension successfully, open a
command window and start the interpreter using irb:

$ irb
irb(main):001:0>

At the prompt, enter

require "Ice"

If the interpreter responds with the value "true", the Ice extension
was loaded successfully. Enter "exit" to quit the interpreter.
However, I get this error message.
Quote:
>> require "Ice"
LoadError: no such file to load -- IceRuby
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/Ice.rb:11
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from (irb):1
Any thoughts as to what might be going on?
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).

Last edited by Tylo : 03-04-2008 at 03:54 PM.
Reply With Quote
  #2 (permalink)  
Old 03-04-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
Under MacOS LD_LIBRARY_PATH is DYLD_LIBRARY_PATH. Did you use that? Do you also have the Ice libraries (and dependencies) in your DYLD_LIBRARY_PATH and the Ice binaries in your PATH?
Reply With Quote
  #3 (permalink)  
Old 03-05-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
Quote:
Originally Posted by matthew View Post
Under MacOS LD_LIBRARY_PATH is DYLD_LIBRARY_PATH. Did you use that? Do you also have the Ice libraries (and dependencies) in your DYLD_LIBRARY_PATH and the Ice binaries in your PATH?
Here is an output of all the things I did for compilation:

Quote:
$ export PATH=/Users/tylo/Documents/Programs/Ice-3.2.1/bin:$PATH

$ export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/Ice-3.2.1/lib:$DYLD_LIBRARY_PATH

$ export DYLD_BIND_AT_LAUNCH=1

$ export PATH=$ICE_HOME/bin:$RUBY_HOME/bin:$PATH

$ export LD_LIBRARY_PATH=$ICE_HOME/lib:$LD_LIBRARY_PATH

$ export PYTHONPATH=/Users/tylo/Documents/Programs/Ice-3.2.1/python:$PYTHONPATH

$ export ICE_HOME=/Users/tylo/Documents/Programs/Ice-3.2.1
After doing that, I was able to compile IceRuby from source.

This is an account of everything I did in order to try and configure Ruby to recognize IceRuby:

Quote:
$ export RUBYLIB=/Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby:$RUBYLIB

$ export PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/bin:$PATH

$ export LD_LIBRARY_PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/lib:LD_LIBRARY_PATH

$ export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/libYLD_LIBRARY_PATH

$ export DYLD_LIBRARY_PATH=$ICE_HOME/lib:$DYLD_LIBRARY_PATH
Ruby still gives the following error:
Quote:
LoadError: no such file to load -- IceRuby
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/Ice.rb:11
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from (irb):1
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).
Reply With Quote
  #4 (permalink)  
Old 03-05-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
Note that you are missing some $ signs.

Code:
$ export LD_LIBRARY_PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/lib:LD_LIBRARY_PATH

$ export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/libYLD_LIBRARY_PATH
LD_LIBRARY_PATH does nothing under Darwin, so no need to set that stuff.

I expect you are not linking the IceRuby bundle correctly. You need to do something like:

Code:
c++  -dynamic -bundle -g -ftemplate-depth-128 -Wall -D_REENTRANT -L../../ruby -o ../../ruby/IceRuby.3.2.1.bundle Communicator.o Init.o ImplicitContext.o Logger.o ObjectFactory.o Operation.o Properties.o Proxy.o Slice.o Types.o Util.o -L../../ruby -L../../../cpp/lib -lIce -lSlice -lIceUtil -L/usr/local/lib -lruby
Reply With Quote
  #5 (permalink)  
Old 03-05-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
First, I'd like to thank you for your help so far. It's much appreciated. I've fixed the missing $ sign (good eye), but it did not yield any results, unfortunately.

Quote:
c++ -dynamic -bundle -g -ftemplate-depth-128 -Wall -D_REENTRANT -L../../ruby -o ../../ruby/IceRuby.3.2.1.bundle Communicator.o Init.o ImplicitContext.o Logger.o ObjectFactory.o Operation.o Properties.o Proxy.o Slice.o Types.o Util.o -L../../ruby -L../../../cpp/lib -lIce -lSlice -lIceUtil -L/usr/local/lib -lruby
I don't quite understand what directory I need to be in to do this. Also you mentioned something like this. I'm not experienced enough in Unix Speech to know what half this stuff is doing. Also, I saw no mention of this step in any ReadMe file. Is this not something that should have been accomplished during the Make process? It appears to be part of the compilation process.

Infact, I just stumbled across this, which appeared somewhere during the Make process:

Quote:
c++ -dynamiclib -g -ftemplate-depth-128 -Wall -D_REENTRANT -L../../ruby -o ../../ruby/IceRuby.3.2.1.dy Communicator.o Init.o ImplicitContext.o Logger.o ObjectFactory.o Operation.o Properties.o Proxy.o Slice.o Types.o Util.o -L../../ruby -L/Users/tylo/Documents/Programs/Ice-3.2.1/lib -lIce -lSlice -lIceUtil -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -lruby
It appears to be what you're speaking of, and it has already been done. Are you suggesting I try that command once more?
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).
Reply With Quote
  #6 (permalink)  
Old 03-05-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
Quote:
Originally Posted by Tylo View Post
I don't quite understand what directory I need to be in to do this. Also you mentioned something like this. I'm not experienced enough in Unix Speech to know what half this stuff is doing. Also, I saw no mention of this step in any ReadMe file. Is this not something that should have been accomplished during the Make process? It appears to be part of the compilation process.
The basic issue is that we don't support Ice for ruby on MacOS. Building the IceRuby bundle is Mac specific, therefore it isn't surprising that you didn't find it in a README.

Quote:
It appears to be what you're speaking of, and it has already been done. Are you suggesting I try that command once more?
You need to replace the link step above with a link step that builds a bundle instead of a shared library. You should get what you need by fixing the config/Make.rules.Darwin to have rules like the following:

Code:
mklibfilename           = $(if $(2),$(1).$(2).bundle,$(1).bundle)
mksoname                = $(if $(2),$(1).$(2).bundle,$(1).bundle)

mklibname               = $(1).bundle
curdir                  = $(shell pwd)

ifeq ($(OPTIMIZE),yes)
   ifneq ($(embedded_runpath_prefix),)
      mkshlib                 = $(CXX)  -bundle $(shlibldflags) -o $(1) -install_name $(runpath_libdir)/$(2) $(3) $(4)
   else
      mkshlib                 = $(CXX)  -bundle $(shlibldflags) -o $(1) -install_name $(2) $(3) $(4)
   endif
else
    # Don't use -install_name if we're building a debug version. GDB doesn't honor the
    # DYLD_LIBRARY_PATH environment variable if a runpath is embedded in the
    # executables or libraries.
    mkshlib                 = $(CXX)  -bundle $(shlibldflags) -o $(1) $(3) $(4)
endif
Reply With Quote
  #7 (permalink)  
Old 03-06-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
Ok, I went ahead and did what you asked, and re-ran the make process. I believe something went wrong, perhaps because I already ran it once before. Maybe you can see what went wrong?

Quote:
$ make
making all in src
making all in IceRuby
rm -f ../../ruby/IceRuby.3.2.1.bundle
c++ -bundle -g -ftemplate-depth-128 -Wall -D_REENTRANT -L../../ruby -o ../../ruby/IceRuby.3.2.1.bundle Communicator.o Init.o ImplicitContext.o Logger.o ObjectFactory.o Operation.o Properties.o Proxy.o Slice.o Types.o Util.o -L../../ruby -L/Users/tylo/Documents/Programs/Ice-3.2.1/lib -lIce -lSlice -lIceUtil -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -lruby
rm -f ../../ruby/IceRuby.32.bundle
ln -s IceRuby.3.2.1.bundle ../../ruby/IceRuby.32.bundle
rm -f ../../ruby/IceRuby.bundle
ln -s IceRuby.32.bundle ../../ruby/IceRuby.bundle
making all in ruby
make[1]: Nothing to be done for `all'.
Afterwards, I tried testing to see if it worked and received the following error message:

Quote:
LoadError: dlopen(/Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle, 9): Library not loaded: /opt/Ice-3.2/lib/libIce.32.dylib
Referenced from: /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle
Reason: image not found - /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle
from /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/Ice.rb:11
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from (irb):1
The Reason: image not found - /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle was a pretty clear indication to me that something was going amiss during the altered make process.
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).
Reply With Quote
  #8 (permalink)  
Old 03-06-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
Quote:
LoadError: dlopen(/Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle, 9): Library not loaded: /opt/Ice-3.2/lib/libIce.32.dylib
...
The Reason: image not found - /Users/tylo/Documents/Programs/IceRuby-3.2.1/ruby/IceRuby.bundle was a pretty clear indication to me that something was going amiss during the altered make process.
It looks to me like the bundle isn't the issue, I think you have built that correctly. What is going on now is that the loading of the bundle is failing because it is searching for the Ice shared library in the embedded shared library path (/opt/...). Since you haven't installed Ice (otherwise it would find the shared library) the library load is failing. Adding the location of the Ice shared library to your DYLD_LIBRARY_PATH should fix the issue.
Reply With Quote
  #9 (permalink)  
Old 03-06-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
Quote:
Adding the location of the Ice shared library to your DYLD_LIBRARY_PATH should fix the issue.
Are you speaking of this command?

Code:
export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/lib:$DYLD_LIBRARY_PATH
I had done this before the rebuild with the new make file you requested, but did it once again to make sure. It did not change where ruby was looking for the library.


I also noticed that the path it is looking for is: /opt/Ice-3.2/lib/libIce.32.dylib , but I have Ice-3.2.1.
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).
Reply With Quote
  #10 (permalink)  
Old 03-06-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
I think I'll make life easier by putting all the Ice components into /opt

Also, I just found out that TeRK requires Ice 3.1.1, so I'll be getting rid of Ice 3.2.1.

I also found out that making a symbolic link
Code:
sudo mkdir /opt
cd /opt
sudo ln -s /Users/tylo/Documents/Programs/IceRuby-3.2.1 /opt/Ice-3.2
likely would have solved my problem in my above post.


EDIT: The "solution" in red didn't actually work...

I'll be back here to report how everything goes...

Thanks,
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).

Last edited by Tylo : 03-06-2008 at 01:03 PM.
Reply With Quote
  #11 (permalink)  
Old 03-06-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
You said:

Quote:
export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/IceRuby-3.2.1/lib:$DYLD_LIBRARY_PATH
You need to ensure the location of the Ice library is in the DYLD_LIBRARY_PATH, not the IceRuby bundle (that is located from the RUBYLIB environment variable).

Earlier you said:

Code:
export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/Ice-3.2.1/lib:$DYLD_LIBRARY_PATH
So, assuming the Ice shared library is in that location, then you need to ensure that this is in the DYLD_LIBRARY_PATH.

If, after correctly setting the DY_LIBRARY_PATH, you cannot get it work you have a couple of alternatives. The simplest is for you to install Ice into /opt. Another is to change the build of Ice to not embed the runtime path for the shared library into the Ice library.

Quote:
I also noticed that the path it is looking for is: /opt/Ice-3.2/lib/libIce.32.dylib , but I have Ice-3.2.1.
That is expected. The embedded runtime path for 3.2.1 shared libraries is /opt/Ice-3.2 since 3.2.1 is fully binary compatible with 3.2. From Make.rules:

Code:
#
# The "root directory" for runpath embedded in executables. Can be unset
# to avoid adding a runpath to Ice executables.
#
embedded_runpath_prefix  ?= /opt/Ice-$(1VERSION_MAJOR).$(VERSION_MINOR)
Reply With Quote
  #12 (permalink)  
Old 03-06-2008
Tylo Tylo is offline
Registered User
 
Name: Tyler Cook
Organization: California University of Pennsylvania
Project: Terk/Qwerk Controller Monitor
 
Join Date: Mar 2008
Posts: 7
Quote:
Earlier you said:
Code:
export DYLD_LIBRARY_PATH=/Users/tylo/Documents/Programs/Ice-3.2.1/lib:$DYLD_LIBRARY_PATH
Yes, this worked. It's definitely worth just shoving all this stuff in /opt, for certain.

Thanks for all the help, Matthew.
__________________
Tyler Cook
California University of Pennsylvania
http://www.cup.edu
Project: Attempting to build a client that connects to a Qwerk Robot Controller (which uses Ice as their server).
Reply With Quote
  #13 (permalink)  
Old 03-06-2008
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
Quote:
Originally Posted by Tylo View Post
...
Also, I just found out that TeRK requires Ice 3.1.1, so I'll be getting rid of Ice 3.2.1.
...
Note that we don't provide free support for older versions of Ice.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
IceRuby in RubyonRail rama Help Center 2 03-15-2007 10:11 AM
IceRuby 3.2 on OSX ctennis Comments 5 03-09-2007 01:08 PM
Possible IceRuby bug? jesse@mind.net Bug Reports 2 01-04-2007 05:55 PM
OSX package on Intel MAC ctennis Bug Reports 2 11-23-2006 09:32 PM
got some errors when compiling Ice-3.0.0 in Mac osX 10.4 zhangzq71 Help Center 2 12-16-2005 11:10 PM


All times are GMT -4. The time now is 12:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.