From: 7stud -- Date: 2009-03-24T17:25:42+09:00 Subject: Re: how do you install a local gem? Joshua Ballanco wrote: > 7stud -- wrote: >> Stefano Crocco wrote: >>> This seems even more strange. The file wxruby-1.9.4.tar.gz is not the >>> gem >>> version, so, even if the file was automatically unzipped, it should be >>> called >>> wxruby-1.9.4.tar >>> >>> If you want to use rubygems, you should download this file: >>> http://rubyforge.org/frs/download.php/30889/wxruby-1.9.4-universal-darwin.gem >>> >>> then use >>> >>> gem install wxruby-1.9.4-universal-darwin.gem >>> >>> Stefano >> >> Whoops. I went to this page: >> >> http://rubyforge.org/frs/?group_id=35 >> >> and I downloaded: >> >> wxruby-1.9.4-universal-darwin.gem >> >> That hit my Desktop as: >> >> wxruby-1.9.4-universal-darwin.gem.tar >> >> and then I had the problems outlined in my first post. > > I recall an article on this recently (I believe from the Apple Developer > Connection). Apparently, due to some form of server oddness, Safari > seems to tack on spurious .tar and .gz extensions. You should be able to > simple rename the file, removing the .tar, and install as normal. I finally got around to messing with this install again, and this time I was able to successfully install wxruby thanks to the advice given here. I installed the latest wxruby 2.0 instead of the version mentioned in my earlier posts. I successfully installed the wxruby 2.0 gem which says it's for darwin-9 even though my system is darwin-8: $ ruby -v ruby 1.8.2 (2004-12-25) [universal-darwin8.0] I got this error trying to install: $ tar -xvf /Users/me/Desktop/wxruby-2.0.0-universal-darwin-9.gem.tar data.tar.gz tar: data.tar.gz: implausibly old time stamp 1969-12-31 17:00:00 metadata.gz tar: metadata.gz: implausibly old time stamp 1969-12-31 17:00:00 $ so I changed the filename on my Desktop to: wxruby-2.0.0-universal-darwin-9.gem i.e. I removed the .tar extension on the end. Then I changed directories to my Desktop: $ cd ~/Desktop and then commanded: ~/Desktop$ gem install wxruby-2.0.0-universal-darwin-9.gem and I immediately got a message that said wxruby installed successfully. Wow that was fast. Ok, now to test the install. I found a basic wxruby example here: http://book.opensourceproject.org.cn/lamp/ruby/cookbook/opensource/0596523696/rubyckbk-chp-21-sect-14.html Instead of typing in the whole example, I decided to see if requiring wxruby would work first. r1test.rb ------- require 'wxruby' Nope: r1test.rb:1:in `require': No such file to load -- wxruby (LoadError) from r1test.rb:1 Oh yeah, there's some ruby gem weirdness about requires. Checking my notes in pickaxe2, I came up with this: require 'rubygems' require 'wxruby' Still didn't work: /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': No such file to load -- wxruby (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from r1test.rb:2 Hmm...the basic example at the link above mentions a tutorial here: http://wxruby.rubyforge.org/wiki/wiki.pl?Getting_Started Ahh, the tutorial uses: require 'wx' Nope: r1test.rb:1:in `require': No such file to load -- wx (LoadError) from r1test.rb:1 Ok, how about: require 'rubygems' require 'wx' That worked. On to the example: require 'rubygems' require 'wx' include Wx class TroutApp < App def on_init frame = Frame.new(nil, -1, "Title") text = StaticText.new(frame, -1, "You are a trout!", Point.new(-1, 1), DEFAULT_SIZE, ALIGN_CENTER) frame.show end end TroutApp.new.main_loop And that worked. Thanks for all the help. -- Posted via http://www.ruby-forum.com/.