I'm having a heck of a time installing hpricot and nothing I've tried has
gotten me any closer to a resolution.
First, let me describe what I'm trying to do...
I have a test file that I'm running from the command line like this:
$ ruby test.rb
And that test file just has this content:
---
require 'rubygems'
require 'hpricot'
xml = %{
<status>
<id>1</id>
<created_at>a date</created_at>
<text>some text</text>
</status>
}
doc = Hpricot::XML(xml)
(doc/:status).each do |status|
['id', 'created_at', 'text'].each do |el|
puts "#{el}: #{status.at(el).innerHTML}"
end
end
----
I got this from a write up that John Nunemaker did and its what got me
interested in hpricot in the first place.
Following his write up I did this to install hpricot:
$ sudo gem install hpricot
Easy, just like all the other gems I've installed - no problems and a gem
list gives me that I'm on 0.8.2. But the result of running the ruby
test.rb command is a mess of errors that I cannot figure out:
/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.8.2/lib/hpricot_scan.bundle:
dlopen(/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.8.2/lib/hpricot_scan.bundle,
9): no suitable image found. Did find: (LoadError)
/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.8.2/lib/hpricot_scan.bundle:
mach-o, but wrong architecture -
/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.8.2/lib/hpricot_scan.bundle
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.8.2/lib/hpricot.rb:20
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from test.rb:2
I've googled all the bits that seemed relevant "mach-o, but wrong
architecture", "no suitable image found", 'gem_original_require", etc. I
got some hits, but nothing that really pointed me in the right direction.
So, in trying to troubleshoot this I've uninstalled and reinstalled, I've
installed with and without sudo and I even tried to install from source by
cloning the git repo. Surely I've made some easy noob mistake, gems have
never given me so much trouble - help!!
Jon
Jon, what platform/OS are you on? ----------------------- i5m.co.uk GPG Key: 0xA18A602B On Tue, Feb 16, 2010 at 3:55 PM, Jonathan Allured <jon.allured@me.com>wrote: > I'm having a heck of a time installing hpricot and nothing I've tried has > gotten me any closer to a resolution. > > >
Actually, I could take a guess at Snow Leopard? ----------------------- i5m.co.uk GPG Key: 0xA18A602B On Tue, Feb 16, 2010 at 4:08 PM, i5m <i5ivem@googlemail.com> wrote: > Jon, > > what platform/OS are you on? > > > ----------------------- > i5m.co.uk > GPG Key: 0xA18A602B > > > > On Tue, Feb 16, 2010 at 3:55 PM, Jonathan Allured <jon.allured@me.com>wrote: > >> I'm having a heck of a time installing hpricot and nothing I've tried has >> gotten me any closer to a resolution. >> >> >> >
you got it - OS X 10.6.2, ruby 1.8.7 On Feb 16, 2010, at 10:09 AM, i5m wrote: > Actually, I could take a guess at Snow Leopard? > ----------------------- > i5m.co.uk > GPG Key: 0xA18A602B > > > On Tue, Feb 16, 2010 at 4:08 PM, i5m <i5ivem@googlemail.com> wrote: > Jon, > > what platform/OS are you on? > > > ----------------------- > i5m.co.uk > GPG Key: 0xA18A602B > > > > On Tue, Feb 16, 2010 at 3:55 PM, Jonathan Allured <jon.allured@me.com> wrote: > I'm having a heck of a time installing hpricot and nothing I've tried has gotten me any closer to a resolution. > > > >
Ok, I've done a bit of googling and it seems this issue crops up now and then. Unfortunately for those that have fixed it the solutions are an unhelpful "This issue has been resolved by reinstalling all gems". From this thread: Starting server is failing on Mac OSX 10.6 Snow Leopard<http://groups.google.ca/group/rubyonrails-talk/browse_thread/thread/9ce65bff47386acb/da693ffc857e430e?lnk=raot> You could try uninstalling the gem and explicitly setting the architecture: > sudo gem uninstall hpricot > sudo env ARCHFLAGS='-arch x86_64' > sudo gem install hpricot The "hpricot_scan.bundle: mach-o, but wrong architecture" error is probably because it's compiled as 32bit, when it should be 64bit. ----------------------- i5m.co.uk GPG Key: 0xA18A602B On Tue, Feb 16, 2010 at 4:49 PM, Jonathan Allured <jon.allured@me.com>wrote: > you got it - OS X 10.6.2, ruby 1.8.7 > > On Feb 16, 2010, at 10:09 AM, i5m wrote: > > Actually, I could take a guess at Snow Leopard? > ----------------------- > i5m.co.uk > GPG Key: 0xA18A602B > > > On Tue, Feb 16, 2010 at 4:08 PM, i5m <i5ivem@googlemail.com> wrote: > >> Jon, >> >> what platform/OS are you on? >> >> >> ----------------------- >> i5m.co.uk >> GPG Key: 0xA18A602B >> >> >> >> On Tue, Feb 16, 2010 at 3:55 PM, Jonathan Allured <jon.allured@me.com>wrote: >> >>> I'm having a heck of a time installing hpricot and nothing I've tried has >>> gotten me any closer to a resolution. >>> >>> >>> >> > >
No luck - I followed those steps and then ran my test.rb file again and got the same error messages. My buddies machine had 0.6 loaded on it, so I uninstalled again and then reinstalled v 0.6 hoping that might work and I still got that same error... On Feb 16, 2010, at 11:07 AM, i5m wrote: > Ok, I've done a bit of googling and it seems this issue crops up now and then. Unfortunately for those that have fixed it the solutions are an unhelpful "This issue has been resolved by reinstalling all gems". > > From this thread: Starting server is failing on Mac OSX 10.6 Snow Leopard > > You could try uninstalling the gem and explicitly setting the architecture: > > > sudo gem uninstall hpricot > > sudo env ARCHFLAGS='-arch x86_64' > > sudo gem install hpricot > > The "hpricot_scan.bundle: mach-o, but wrong architecture" error is probably because it's compiled as 32bit, when it should be 64bit. > ----------------------- > i5m.co.uk > GPG Key: 0xA18A602B > > > On Tue, Feb 16, 2010 at 4:49 PM, Jonathan Allured <jon.allured@me.com> wrote: > you got it - OS X 10.6.2, ruby 1.8.7 > > On Feb 16, 2010, at 10:09 AM, i5m wrote: > >> Actually, I could take a guess at Snow Leopard? >> ----------------------- >> i5m.co.uk >> GPG Key: 0xA18A602B >> >> >> On Tue, Feb 16, 2010 at 4:08 PM, i5m <i5ivem@googlemail.com> wrote: >> Jon, >> >> what platform/OS are you on? >> >> >> ----------------------- >> i5m.co.uk >> GPG Key: 0xA18A602B >> >> >> >> On Tue, Feb 16, 2010 at 3:55 PM, Jonathan Allured <jon.allured@me.com> wrote: >> I'm having a heck of a time installing hpricot and nothing I've tried has gotten me any closer to a resolution. >> >> >> >> > >
Ok, all is not lost. This seems to crop up with other gems as well. http://stackoverflow.com/questions/1367380/snow-leopard-64-bit-ruby-gem-problem Have a look through this. If you look at all the comments to the first answer, then the person posting the question had the wrong setting in their bash profile that was overriding the x86_64 flag. Would be worth checking if you are inadvertently specifying i386 somewhere. http://www.tommycampbell.net/2009/08/29/snow-leopard-not-completely-intel-only This post is interesting. I wonder if those that get Hpricot to install are using their own install of Ruby 1.9? I.e. Could the Apple Ruby install be causing some issues? It might be worth having a go installing Ruby 1.9 from source and seeing if you can install Hpricot with that. http://lists.macosforge.org/pipermail/macruby-devel/2009-December/003513.html Then again this post and this follow up http://lists.macosforge.org/pipermail/macruby-devel/2009-December/003532.html would seem to imply the opposite and that it should just work. Do you have any different versions of Ruby installed? What happens of you do: which ruby which gem sudo which ruby sudo which gem I.e is it picking up a different version when running via sudo? What about using the "file" command on the binaries of yout Hpricot install just to find out what architecture it is. I.e file /path/to/hpricot_scan.bundle It should be 64 bit. I'm going to guess it's 32 bit. Which means i386 is being specified somewhere during build. http://rubyforge.org/pipermail/nokogiri-talk/2009-June/000337.html Lastly, this thread on the Nokogiri list shows they had to change something for Snow Leopard. I don't think this is the case for Hpricot since it seems to install for some folk, but might be something to look into if all else fails. On 16 Feb 2010, at 17:29, Jonathan Allured <jon.allured@me.com> wrote: > No luck - I followed those steps and then ran my test.rb file again > and got the same error messages. My buddies machine had 0.6 loaded > on it, so I uninstalled again and then reinstalled v 0.6 hoping that > might work and I still got that same error...
I see what you mean about inadvertently specifying i386 somewhere, but I'm not really clear where I should be looking for it. I did examine ~/.profile thinking it could be in there, but it wasn't. Is there somewhere else I should be looking? > which ruby /usr/local/bin/ruby > which gem /usr/local/bin/gem > sudo which ruby /usr/local/bin/ruby > sudo which gem /usr/local/bin/gem > ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.6.0] > sudo ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.6.0] I've never messed with my ruby install - am I right in inferring that one can have multiple versions of ruby installed on a machine? I saw something in one of those posts about a default version of ruby and that made me think that I could have 1.8.7 and 1.9 going - is this how you have it? Do you run 1.9? > file hpricot_scan.bundle hpricot_scan.bundle: Mach-O 64-bit bundle x86_64 I ran that file command on every file in the hpricot folder and none of them came back as 32 bit. Thanks for helping me with this, sorry the results of your tips weren't better! Jon On Feb 16, 2010, at 4:33 PM, i5m wrote: > Ok, all is not lost. This seems to crop up with other gems as well. > > http://stackoverflow.com/questions/1367380/snow-leopard-64-bit-ruby-gem-problem > > Have a look through this. If you look at all the comments to the first > answer, then the person posting the question had the wrong setting in > their bash profile that was overriding the x86_64 flag. Would be worth > checking if you are inadvertently specifying i386 somewhere. > > http://www.tommycampbell.net/2009/08/29/snow-leopard-not-completely-intel-only > > This post is interesting. I wonder if those that get Hpricot to > install are using their own install of Ruby 1.9? I.e. Could the Apple > Ruby install be causing some issues? It might be worth having a go > installing Ruby 1.9 from source and seeing if you can install Hpricot > with that. > > http://lists.macosforge.org/pipermail/macruby-devel/2009-December/003513.html > > Then again this post and this follow up > > http://lists.macosforge.org/pipermail/macruby-devel/2009-December/003532.html > > would seem to imply the opposite and that it should just work. Do you > have any different versions of Ruby installed? > > What happens of you do: > > which ruby > which gem > sudo which ruby > sudo which gem > > I.e is it picking up a different version when running via sudo? > > What about using the "file" command on the binaries of yout Hpricot > install just to find out what architecture it is. I.e > > file /path/to/hpricot_scan.bundle > > It should be 64 bit. I'm going to guess it's 32 bit. Which means i386 > is being specified somewhere during build. > > http://rubyforge.org/pipermail/nokogiri-talk/2009-June/000337.html > > Lastly, this thread on the Nokogiri list shows they had to change > something for Snow Leopard. I don't think this is the case for Hpricot > since it seems to install for some folk, but might be something to > look into if all else fails. > > > On 16 Feb 2010, at 17:29, Jonathan Allured <jon.allured@me.com> wrote: > >> No luck - I followed those steps and then ran my test.rb file again >> and got the same error messages. My buddies machine had 0.6 loaded >> on it, so I uninstalled again and then reinstalled v 0.6 hoping that >> might work and I still got that same error...
Jon, this is getting confusing then. ;-) See lots of comments below. On 17 Feb 2010, at 15:19, Jonathan Allured <jon.allured@me.com> wrote: I see what you mean about inadvertently specifying i386 somewhere, but I'm not really clear where I should be looking for it. I did examine ~/.profile thinking it could be in there, but it wasn't. Is there somewhere else I should be looking? Don't think there is any need to worry about this because as you show below hpricot_scan.bundle is getting built correctly so the error must be with something else. Probably. Maybe (because just realised your Ruby install is in an odd place). I've never messed with my ruby install - am I right in inferring that one can have multiple versions of ruby installed on a machine? You can have as many as you want. And actually, I notice your Ruby install is at /usr/local/bin/ruby. That seems odd. The system Ruby should be at /usr/bin/ruby. At least it is on OSX 10.5. I saw something in one of those posts about a default version of ruby and that made me think that I could have 1.8.7 and 1.9 going - is this how you have it? Do you run 1.9? Unfortunately I'm still on a PPC Mac, but on that I have the system Ruby 1.8.6, a Macports installed Ruby 1.9 and another 1.9 I built from source. Oh and jRuby as well. I have similar on Windows as well. file hpricot_scan.bundle hpricot_scan.bundle: Mach-O 64-bit bundle x86_64 Well I'm confused. If it is saying that is the wrong architecture then perhaps it is trying to run Ruby and gems as 32bit? So while we are at it: - Do you have a 32bit or 64bit Mac? See here: http://support.apple.com/kb/HT3696 - What do you get if you do "file /usr/local/bin/ruby" and "file /usr/local/bin/gem? - Do you have /usr/bin/ruby and /usr/bin/gem? If so what architecture are they? - Did you upgrade to Snow Leopard? Or is this a fresh install? - Did you install the developer tools from the Snow Leopard disc? (i.e. make sure you are not using the 10.5 developer tools if you upgraded the OS) - what's the result of "gem env"? If you want and are willing, you could also re-install Ruby. There is a good guide here: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard Note that this installs in /usr/local/. The idea behind this is that it doesn't 'replace' the system install. But as I said above your default Ruby seems to be at /usr/local which is odd. I, like you I guess, have done a stack of googling on gems and Snow Leopard and this "wrong architecture" thing seems to crop up a lot. Not just for Hpricot. A lot of the 'solutions' seem to involve rebuilding Ruby, etc.
I checked and I do have a 64-bit machine. When I went from Leopard to
Snow Leopard I didn't do a clean install, I think I chose something like
archive and install so that it wouldn't really change my user stuff.
Anyway, I think you figured it out!! My /usr/local/bin/ruby is i386, see below:
$ file /usr/local/bin/ruby
/usr/local/bin/ruby: Mach-O executable i386
$ file /usr/local/bin/gem
/usr/local/bin/gem: a /usr/local/bin/ruby script text executable
$ file /usr/bin/ruby
/usr/bin/ruby: Mach-O universal binary with 3 architectures
/usr/bin/ruby (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/ruby (for architecture i386): Mach-O executable i386
/usr/bin/ruby (for architecture ppc7400): Mach-O executable ppc
$ file /usr/bin/gem
/usr/bin/gem: a /System/Library/Frameworks/Ruby script text executable
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.6.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-9
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /Users/jon/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
So, what does this mean? It looks like I have a second ruby and gem
installed where you expected them to be in /usr/bin - can I just delete
the other installs in /usr/local/bin? I'm afraid of messing with this
stuff since this is my main work machine and I don't want to screw up my
system!
Jon
On Feb 17, 2010, at 5:55 PM, i5m wrote:
> Jon,
>
> this is getting confusing then. ;-) See lots of comments below.
>
> On 17 Feb 2010, at 15:19, Jonathan Allured <jon.allured@me.com> wrote:
>
>> I see what you mean about inadvertently specifying i386 somewhere, but
I'm not really clear where I should be looking for it. I did examine
~/.profile thinking it could be in there, but it wasn't. Is there
somewhere else I should be looking?
> Don't think there is any need to worry about this because as you show
below hpricot_scan.bundle is getting built correctly so the error must be
with something else. Probably. Maybe (because just realised your Ruby
install is in an odd place).
>> I've never messed with my ruby install - am I right in inferring that
one can have multiple versions of ruby installed on a machine?
>
> You can have as many as you want. And actually, I notice your Ruby
install is at /usr/local/bin/ruby. That seems odd. The system Ruby should
be at /usr/bin/ruby. At least it is on OSX 10.5.
>
>> I saw something in one of those posts about a default version of ruby
and that made me think that I could have 1.8.7 and 1.9 going - is this how
you have it? Do you run 1.9?
> Unfortunately I'm still on a PPC Mac, but on that I have the system Ruby
1.8.6, a Macports installed Ruby 1.9 and another 1.9 I built from source.
Oh and jRuby as well. I have similar on Windows as well.
>
>>> file hpricot_scan.bundle
>> hpricot_scan.bundle: Mach-O 64-bit bundle x86_64
>
> Well I'm confused. If it is saying that is the wrong architecture then
perhaps it is trying to run Ruby and gems as 32bit?
>
> So while we are at it:
>
> - Do you have a 32bit or 64bit Mac? See here: http://support.apple.com/kb/HT3696
> - What do you get if you do "file /usr/local/bin/ruby" and "file
/usr/local/bin/gem?
> - Do you have /usr/bin/ruby and /usr/bin/gem? If so what architecture are they?
> - Did you upgrade to Snow Leopard? Or is this a fresh install?
> - Did you install the developer tools from the Snow Leopard disc? (i.e.
make sure you are not using the 10.5 developer tools if you upgraded the
OS)
> - what's the result of "gem env"?
>
> If you want and are willing, you could also re-install Ruby. There is a
good guide here:
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard
>
> Note that this installs in /usr/local/. The idea behind this is that it
doesn't 'replace' the system install. But as I said above your default
Ruby seems to be at /usr/local which is odd.
>
> I, like you I guess, have done a stack of googling on gems and Snow
Leopard and this "wrong architecture" thing seems to crop up a lot. Not
just for Hpricot. A lot of the 'solutions' seem to involve rebuilding
Ruby, etc.
>
Sorry, one more thing - I originally did follow one of the hivelogic tutorials on installing stuff and I remembered that a part of that process was setting your path in ~/.profile, so here's what I've got in mine: export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" Could this be a part of the problem too?? Jon On Feb 17, 2010, at 5:55 PM, i5m wrote: > Jon, > > this is getting confusing then. ;-) See lots of comments below. > > On 17 Feb 2010, at 15:19, Jonathan Allured <jon.allured@me.com> wrote: > >> I see what you mean about inadvertently specifying i386 somewhere, but I'm not really clear where I should be looking for it. I did examine ~/.profile thinking it could be in there, but it wasn't. Is there somewhere else I should be looking? > Don't think there is any need to worry about this because as you show below hpricot_scan.bundle is getting built correctly so the error must be with something else. Probably. Maybe (because just realised your Ruby install is in an odd place). >> I've never messed with my ruby install - am I right in inferring that one can have multiple versions of ruby installed on a machine? > > You can have as many as you want. And actually, I notice your Ruby install is at /usr/local/bin/ruby. That seems odd. The system Ruby should be at /usr/bin/ruby. At least it is on OSX 10.5. > >> I saw something in one of those posts about a default version of ruby and that made me think that I could have 1.8.7 and 1.9 going - is this how you have it? Do you run 1.9? > Unfortunately I'm still on a PPC Mac, but on that I have the system Ruby 1.8.6, a Macports installed Ruby 1.9 and another 1.9 I built from source. Oh and jRuby as well. I have similar on Windows as well. > >>> file hpricot_scan.bundle >> hpricot_scan.bundle: Mach-O 64-bit bundle x86_64 > > Well I'm confused. If it is saying that is the wrong architecture then perhaps it is trying to run Ruby and gems as 32bit? > > So while we are at it: > > - Do you have a 32bit or 64bit Mac? See here: http://support.apple.com/kb/HT3696 > - What do you get if you do "file /usr/local/bin/ruby" and "file /usr/local/bin/gem? > - Do you have /usr/bin/ruby and /usr/bin/gem? If so what architecture are they? > - Did you upgrade to Snow Leopard? Or is this a fresh install? > - Did you install the developer tools from the Snow Leopard disc? (i.e. make sure you are not using the 10.5 developer tools if you upgraded the OS) > - what's the result of "gem env"? > > If you want and are willing, you could also re-install Ruby. There is a good guide here: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard > > Note that this installs in /usr/local/. The idea behind this is that it doesn't 'replace' the system install. But as I said above your default Ruby seems to be at /usr/local which is odd. > > I, like you I guess, have done a stack of googling on gems and Snow Leopard and this "wrong architecture" thing seems to crop up a lot. Not just for Hpricot. A lot of the 'solutions' seem to involve rebuilding Ruby, etc. >
Jon, On Thu, Feb 18, 2010 at 3:21 PM, Jonathan Allured <jon.allured@me.com>wrote: > Sorry, one more thing - I originally did follow one of the hivelogic > tutorials on installing stuff and I remembered that a part of that process > was setting your path in ~/.profile, so here's what I've got in mine: > > export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" > > Could this be a part of the problem too?? > Yes, this is (Lots of fingers crossed!) hopefully the issue. Basically the Hpricot gem has built and installed correctly as 64bit. But your default ruby is a 32bit one, left over from Leopard and when you'd previously followed the Hivelogic tutorial. As a quick check that things are actually ok, try: /usr/bin/ruby test.rb It might still not work because your gems are in /usr/local/bin, so you might still get a bit of a conflict, but this would call the correct Ruby. Two solutions: 1) Keep your path in .profile, but rebuild the version of Ruby there as per the latest Hivelogic tutorial. 2) Remove that path from your profile. You don't have to delete things from /usr/local, leave them there to be on the safe side. But you will have to re-install Hpricot, because this time the gem will install to /usr/lib/... i.e. not /usr/local On Thu, Feb 18, 2010 at 3:17 PM, Jonathan Allured <jon.allured@me.com> wrote: > So, what does this mean? It looks like I have a second ruby and gem > installed where you expected them to be in /usr/bin - can I just delete the > other installs in /usr/local/bin? I'm afraid of messing with this stuff > since this is my main work machine and I don't want to screw up my system! > > What did you install into /usr/local? I'm assuming if you followed the Hivelogic tutorial it would be for using Ruby on Rails? Did you ever develop anything? Without knowing your setup, the only thing I'd be wary of deleting by removing /usr/local would be a mysql database if you had one. But you might have installed other applications to this location without realising it. Safest option is probably leave this alone. Just remove the path from your profile, re-install hpricot (because it won't be available to you as you won't be referencing /usr/local), and see if that works. Good luck, i5m
Yep, that was totally it - I commented out that path line in .profile, restarted terminal and my test.rb file executed as expected. You sir, are a genius and I really appreciate your help! Jon On Feb 18, 2010, at 9:39 AM, i5m wrote: > Jon, > > On Thu, Feb 18, 2010 at 3:21 PM, Jonathan Allured <jon.allured@me.com> wrote: > Sorry, one more thing - I originally did follow one of the hivelogic tutorials on installing stuff and I remembered that a part of that process was setting your path in ~/.profile, so here's what I've got in mine: > > export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" > > Could this be a part of the problem too?? > > Yes, this is (Lots of fingers crossed!) hopefully the issue. Basically the Hpricot gem has built and installed correctly as 64bit. But your default ruby is a 32bit one, left over from Leopard and when you'd previously followed the Hivelogic tutorial. > > As a quick check that things are actually ok, try: > > /usr/bin/ruby test.rb > > It might still not work because your gems are in /usr/local/bin, so you might still get a bit of a conflict, but this would call the correct Ruby. > > Two solutions: > > 1) Keep your path in .profile, but rebuild the version of Ruby there as per the latest Hivelogic tutorial. > > 2) Remove that path from your profile. You don't have to delete things from /usr/local, leave them there to be on the safe side. But you will have to re-install Hpricot, because this time the gem will install to /usr/lib/... i.e. not /usr/local > > On Thu, Feb 18, 2010 at 3:17 PM, Jonathan Allured <jon.allured@me.com> wrote: > So, what does this mean? It looks like I have a second ruby and gem installed where you expected them to be in /usr/bin - can I just delete the other installs in /usr/local/bin? I'm afraid of messing with this stuff since this is my main work machine and I don't want to screw up my system! > > What did you install into /usr/local? I'm assuming if you followed the Hivelogic tutorial it would be for using Ruby on Rails? Did you ever develop anything? Without knowing your setup, the only thing I'd be wary of deleting by removing /usr/local would be a mysql database if you had one. But you might have installed other applications to this location without realising it. > > Safest option is probably leave this alone. Just remove the path from your profile, re-install hpricot (because it won't be available to you as you won't be referencing /usr/local), and see if that works. > > Good luck, > > i5m > >
If I was a genius I would have spotted the /usr/local on your first email. But, I am very glad it's all working. (Bizarrely I had a dream(nightmare?) about this last night and you'd responded saying there was no ruby installed at /usr/bin which left me very confused... probably shouldn't admit that). All the best, i5m ----------------------- i5m.co.uk GPG Key: 0xA18A602B On Thu, Feb 18, 2010 at 3:56 PM, Jonathan Allured <jon.allured@me.com>wrote: > Yep, that was totally it - I commented out that path line in .profile, > restarted terminal and my test.rb file executed as expected. You sir, are a > genius and I really appreciate your help! > > Jon > > > >