From: Daniel Wilkerson Date: 2008-03-28T06:49:01+09:00 Subject: Re: Help installing fxruby on osx Lyle Johnson wrote: > On Wed, Mar 26, 2008 at 9:40 PM, Daniel Wilkerson > wrote: > >> So everything should work. Except when I try "require 'fox16'" in a >> ruby program, I still get an error. >> >> ./fxruby1.rb:7:in `require': no such file to load -- fox16 (LoadError) > > OK, just so I understand it, at this point you've built both FOX and > FXScintilla from scratch (not via MacPorts), and then installed FXRuby > via RubyGems. And you're using the built-in Ruby that comes with Mac > OS 10.5, not a Ruby that you built yourself. Why doesn't Apple just make one way to install things? Their strength seems to be system integration, and yet they really fall down here. > The error message suggests, then, that you don't have your RUBYOPT > environment variable set so that it automatically loads up RubyGems. > For that, see the instructions under "Using RUBYOPT" at this page: > > http://www.rubygems.org/read/chapter/3 So you mean put this into my .profile: export RUBYOPT=rubygems Doing that and then also running /Applications/Utilities/X11.app (NOT XDarwin!) works. >> However there are now fox16 files in my system. >> >> Macintosh-2:ruby dsw$ find /Library/Ruby -iname "*fox16*" >> /Library/Ruby/Gems/1.8/doc/fxruby-1.6.13/rdoc/files/lib/fox16 >> /Library/Ruby/Gems/1.8/gems/fxruby-1.6.13/ext/fox16 >> /Library/Ruby/Gems/1.8/gems/fxruby-1.6.13/ext/fox16/fox16.bundle >> /Library/Ruby/Gems/1.8/gems/fxruby-1.6.13/lib/fox16 >> Macintosh-2:ruby dsw$ > > Right, this looks plausible. > >> Yet no combinations of adding them to my path seem to work... > > No, it wouldn't. You need to do this the right way, going through > RubyGems' load mechanism. And gems is not just "built-in" to ruby? Why do I have to tell ruby about ruby gems? >> Now, please note that ports doesn't work either: >> >> Macintosh-2:ruby dsw$ sudo port install rb-fxruby >> Password: >> Skipping org.macports.activate (rb-fxruby ) since this port is already >> active >> ---> Cleaning rb-fxruby >> Macintosh-2:ruby dsw$ cat fxruby1.rb && echo && ruby ./fxruby1.rb > > You're mixing up two different Ruby installations. The "ruby" that's > installed in /usr/bin is the one you're running here, and it's the one > that came with Mac OS X, so this is just another manifestation of the > previous problem. The "ruby" that MacPorts installed along with the > "rb-fxruby" port is found in /opt/local/bin, and it has an entirely > separate library of gems and what-not. See above comment about the stupidity of there being more than one "namespace" in which applications can be installed. >> So I have it installed with fink, gems, and ports and it still doesn't >> work. Why do both fink and ports fail so often? They fail more often >> than they work. > > MacPorts worked really well before OS 10.5, and it still works well in > general, but the introduction of a built-in ruby alongside the > MacPorts ruby has really complicated things. To make matters worse, > many (most?) Rubyists will just download the Ruby source code and > build their own version, which gets installed in yet another location > (usually, /usr/local). It has turned into a real maintenace and > support nightmare. Again, Apple should try to coordinate all of these software distribution / installation mechanisms. How do we suggest it to them? >> Anyway, I was enthusiastic about using FXRuby but I would be a lot more >> enthusiastic if it would actually work. > > Please let me know how it goes after you get RUBYOPT set for using > RubyGems with your built-in Ruby. It sounds like you're closer than > you think. So, as above, it works now. Thank you for your help. One question though: Suppose I build a GUI app using Fox and FXRuby and I want to distribute it for all 3 platforms. How do I package it up? -- Posted via http://www.ruby-forum.com/.