Replaced Rails Package with HiveLogic Install - problems


#1

Hi,

I’ve got a strange problem. I had initially installed Rails using Tony
Arnold’s package:

http://www.tonyarnold.com/articles/category/rails

and that worked fine. (on OS X, obviously). I then decided to
reinstall using the instructions on the HiveLogic page, to get Ruby
1.8.4:

http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger

That seemed to go well - I had everything installed. The one thing I
did, since Tony included a bunch of gems with his package, was to copy
the gems to the new /usr/local/lib directory:

/usr/lib/ruby/gems/1.8/* -> /usr/local/lib/ruby/gems

I’m able to create a new rails app and run it with script/server and
lighttpd starts up.

However. I was playing with a Rails app - Tracks - and tried to run
it, but it would not start up. I found that I had to remove the
lighttpd.conf file and let it be recreated. I then noticed that it was
being copied from my /usr/lib/ruby/gems… directory… not the
/usr/local/lib directory.

So… I tried removing all the gems from /usr/lib… (my path is set
correctly to use /usr/local/bin first).

Now… when I try to start the server, I’m getting an error:

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
require__': No such file to load -- initializer (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire’
from ./script/…/config/boot.rb:14
from script/server:2:in `require’
from script/server:2

But ONLY in the existing Tracks app folder. Starting from a new rails
app folder correctly runs (and will copy the lighttpd.conf file from
the /usr/local/lib… directory.)

Somewhere in the old tracks app folder it’s still referring to the
(now non-existant) /usr/lib/ruby/… stuff… and I can’t find it!

Does anyone have some insight? Please?

Thanks!

jt


#2

On Apr 4, 2006, at 1:36 PM, John T. wrote:

lighttpd starts up.
Now… when I try to start the server, I’m getting an error:
But ONLY in the existing Tracks app folder. Starting from a new rails

jt

Just off the top of my head, it looks like you are running the version
of ruby that comes with MACOSX that is in /usr/bin. Type “which ruby”
in a terminal window to find out the path to your ruby interpreter.
If you installed a 1.8.4 ruby in /usr/local/bin, you need to make sure
that one is run by removing or renaming the one in /usr/bin, or by
modifying your search path to look in /usr/local/bin before looking
in /usr/bin, or specifying the absolute path to your ruby executable.

Hope that helps.
Kim

Kim S. - principal, Shrier and Deihl - mailto:removed_email_address@domain.invalid
Remote Unix Network Admin, Security, Internet Software Development
Tinker Internet Services - Superior FreeBSD-based Web Hosting
http://www.tinker.com/


#3

I do have /usr/local/bin in my path statement.

Creating a new Rails app will use the ruby that is in /usr/local/bin.

For some reason, when I try to do anything with the “tracks” Rails app
(which I had used successfully prior to my “HiveLogic” install), the
system insists on using /usr/bin/ruby. Doing ‘which ruby’ in the
Tracks folder does show /usr/local/bin/ruby.

I thought there may be some configuration setting somewhere that is
overriding what is set in the PATH, but doing a search of the whole
project comes up empty.

I was just playing around with that app, so not a huge deal if I can’t
get it working. I’ll just trash it - I was just wondering how borked
my system is…

Thanks, though.


#4

On 4/4/06, John T. removed_email_address@domain.invalid wrote:

I do have /usr/local/bin in my path statement.

Creating a new Rails app will use the ruby that is in /usr/local/bin.

anyone have any idea why an existing app would want to use
/usr/bin/ruby and look for files in
/usr/lib/ruby/site_ruby/1.8/rubygems and not in /usr/local/lib ?

thanks


#5

#!/usr/bin/env ruby

Same as a new app that works without problems.


#6

What’s the shebang line (first line of dispatch.fcgi) say? It may be
pointing at the old ruby…

John T. wrote:

On 4/4/06, John T. removed_email_address@domain.invalid wrote:

I do have /usr/local/bin in my path statement.

Creating a new Rails app will use the ruby that is in /usr/local/bin.

anyone have any idea why an existing app would want to use
/usr/bin/ruby and look for files in
/usr/lib/ruby/site_ruby/1.8/rubygems and not in /usr/local/lib ?

thanks


#7

Duh. My bad.

I checked the files in the script/ directory (script/server,
script/console, etc.) and most of them began with #!/usr/bin/ruby…

Replaced them with #!/usr/bin/env ruby and all seems well now.

Thanks again.

jt