[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: uninstalling the mac tiger version of ruby

Felix Windt

9/21/2007 2:36:00 AM

> -----Original Message-----
> From: list-bounce@example.com
> [mailto:list-bounce@example.com] On Behalf Of Aaron Massey
> Sent: Thursday, September 20, 2007 5:05 PM
> To: ruby-talk ML
> Subject: Re: uninstalling the mac tiger version of ruby
>
> Thanks for the responses! Obviously, removing the Apple
> installation of
> ruby and replacing it with simlinks works.
>
> I ended up installing mongrel and using that to solve the
> problem though
> if only because I don't like blowing away files that Apple
> might simply
> replace in future updates.
>
> I did want to point out that the other recommendation I received does
> not work. It was actually what I did when I originally
> installed ruby
> manually, so perhaps it is useful to post a sample session that shows
> the problem more clearly:
>
> /* my local install ruby is first in my path */
> bash $ which ruby
> /usr/local/bin/ruby
>
> /* note the versions of my manual install and of the default */
> bash $ /usr/local/bin/ruby -v
> ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.10.0]
> bash $ /usr/bin/ruby -v
> ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
>
> /* see which one WEBrick is picking? */
> bash $ ./script/server
> => Booting WEBrick...
> => Rails application started on http://0....
> => Ctrl-C to shutdown server; call with --help for options
> [2007-09-20 19:37:03] INFO WEBrick 1.3.1
> [2007-09-20 19:37:03] INFO ruby 1.8.2 (2004-12-25)
> [powerpc-darwin8.0]
> [2007-09-20 19:37:03] INFO WEBrick::HTTPServer#start:
> pid=795 port=3000
>
>
> For some reason, even though I have /usr/local/bin listed first in my
> path (as Hivelogic suggests in their manual install instructions) the
> WEBrick server still uses the Apple default ruby
> installation. It could
> be a weirdness with the way Apple sets up their default $PATH
> variable
> or it could be that WEBrick simply ignores local environment
> variables.
>
> I can't determine which is the case because I really don't know much
> about WEBrick and I can't find where OS X sets up its default
> environment variables. (Though, I would like to know if anyone knows
> off the top of their head...)
>
> If it is a problem with WEBrick, I would be willing to file a bug or
> whatever to help the developers. Obviously, I would like to
> confirm it
> before wasting their time. I guess it's kind of a simple
> bug, but this
> is the sort of thing that looks like it would have high
> visibility with
> new rails developers on Mac OS X. Maybe it only shows up as
> a problem
> until Apple releases their next OS, but there could be folks
> stuck on OS
> X 10.4.x for a while afterwards that might run into this. It
> could also
> manifest later in some form.
>
> It is perhaps useful to point out that because I've also
> installed gem
> in the following location:
>
>
> bash $ which gem
> /usr/local/bin/gem
>
>
> As a result, anything I install via gem is ignored by WEBrick. For
> example, trying to start up a rails app with an sqlite3
> database (which
> uses the sqlite3 plugin I've installed via gem) provides an error
> message:
>
>
> bash $ gem list --local sqlite3
>
> *** LOCAL GEMS ***
>
> sqlite3-ruby (1.2.1)
> SQLite3/Ruby is a module to allow Ruby scripts to interface with a
> SQLite3 database.
> bash $ ./script/server
> => Booting WEBrick...
> => Rails application started on http://0....
> => Ctrl-C to shutdown server; call with --help for options
> [2007-09-20 19:44:13] INFO WEBrick 1.3.1
> [2007-09-20 19:44:13] INFO ruby 1.8.2 (2004-12-25)
> [powerpc-darwin8.0]
> [2007-09-20 19:44:13] INFO WEBrick::HTTPServer#start:
> pid=799 port=3000
>
> ===+ WEB BROWSER ERROR MESSAGE +===
> No such file to load -- sqlite3
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
> ===+ TRUNCATED FOR CLARITY +===
>
>
> Anyhow, because mongrel is installed via a gem, it seems to recognize
> the other gems installed on the system, so I'm going to use that for
> now. However, it does seem that the only fully functional
> recourse in
> some cases appears to be actually blowing away the Apple install of
> ruby.
>
> Thanks again for the help!
> --
> Posted via http://www.ruby-....
>

If you do a "cat script/server" from the base directory of your rails
application, what Ruby path does the shebang line point to?

Felix
1 Answer

Aaron Massey

9/21/2007 2:59:00 AM

0

Felix Windt wrote:
> If you do a "cat script/server" from the base directory of your rails
> application, what Ruby path does the shebang line point to?
>
> Felix


#!/usr/bin/ruby

This was the problem. Normally it is "#!/usr/bin/env ruby" but I had
pulled a rails project from a friend's svn server and apparently it was
setup differently on his system. I simply never thought to look there.

At least it wasn't forgetting to set my environment variable in bash.
I've been using bash for around 12 years now and I'm familiar with the
various ways of setting environment variables on *nix systems. ;-)

Thanks for all the help folks!

Actually, now that I think about it. Is there a way to reset the
shebangs on all the rails scripts without inadvertently pushing them
back to svn? That's going to be a bit of a pain if we're fighting over
the shebangs with every commit.



--
Posted via http://www.ruby-....