Please help fixing gems on OSX

A

andre in LA

Hi, I am new to OSX and am a beginner rails developer.

I installed ruby 1.84 and ruby gems and rails and for a while
everything worked well.

Recently I tried to update rails using the gems manager and it failed,
producing an error referring to an incorrect date (sorry, didn't save
that error).

Since then I re-installed the gems manager and it fails completely
with:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
`initialize': uninitialized constant Gem::CommandManager::HelpCommand
(NameError)
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:46:in
`instance'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run'
from /usr/local/bin/gem:23


Is there someting I can do to fix this, or whould I reinstall (a URl
with clear instructions for removal + installation?) or should I
consider reinstalling ruby (how do I remove it?)

Thank you!

-- Andre
 
C

Chris Gehlker

Recently I tried to update rails using the gems manager and it failed,
producing an error referring to an incorrect date (sorry, didn't save
that error).

Since then I re-installed the gems manager and it fails completely
with:

Andre,

If you installed 1.8.4 you already had gems. You didn't need to
install anything else.

If you built Ruby with:

/configure
make
make test
sudo make install

Just do that over.
 
A

andre in LA

Please consider my being very new to Mac OSX and BSD Unix.

I installed Ruby 1.8.4 by following a list of shell commands ( I
believe
http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger
).

I don't mind downloading/installing everything again; I am just not
sure whether this would fix the issue. Maybe I need to remove the
current ruby installation/configuration files first? If so, are there
instructions somewhere? I googled for uninstalling ruby / fixing gems
but could not find anything useful.

Thank you in advance,

-- Andre
 
C

Chris Gehlker

Please consider my being very new to Mac OSX and BSD Unix.

I installed Ruby 1.8.4 by following a list of shell commands ( I
believe
http://hivelogic.com/articles/2005/12/01/
ruby_rails_lighttpd_mysql_tiger
).

OK, I would have used .bash_profile rather than .bash_login but OK.
The part about needing to install readln and gems separately is just
mistaken but I can't see how it would do any harm. Using curl to
download a file rather than just clicking on the link also strikes me
as weird but it should work.


One think that is emphasized, but is easy to get get wrong, is
setting your path so that you will be accessing the new Ruby rather
than the old one. Try typing
'which ruby' on the command line. Report back what it says. If it's
not /usr/local/bin/ruby then your path isn't set right. You can also
do 'ruby -v' to make sure you have 10.8.4 or 5.

Finally, you need a file named .inputrc in your home folder that
contains:
set completion-ignore-case On


This has nothing to do with ruby. it just makes it bearable to use
bash on a case insensitive file system with the case sensitive unix
tools.
 
C

Chris Gehlker

Incorrect. No version of Ruby ships with Rubygems.

Huh?


Last login: Wed Aug 16 03:32:11 on ttyp1
Welcome to Darwin!
~ $ which gem
/usr/local/bin/gem

Did the elves sneak in and install this on my machine? I know I didn't.
 
E

Eric Hodel

Huh?


Last login: Wed Aug 16 03:32:11 on ttyp1
Welcome to Darwin!
~ $ which gem
/usr/local/bin/gem

Did the elves sneak in and install this on my machine? I know I
didn't.

Somebody downloaded the rubygems tarball and ran sudo ruby setup.rb
on your machine. That's how it got there.
 
L

Logan Capaldo

Huh?


Last login: Wed Aug 16 03:32:11 on ttyp1
Welcome to Darwin!
~ $ which gem
/usr/local/bin/gem

Did the elves sneak in and install this on my machine? I know I
didn't.
yes the elves did sneak in. Don't believe me or Eric? Download
ruby-1.8.4.tar.gz, install it to some prefix of your choosing and
grep for gem.
 
C

Chris Gehlker

yes the elves did sneak in. Don't believe me or Eric? Download
ruby-1.8.4.tar.gz, install it to some prefix of your choosing and
grep for gem.

Well, I actually though of that and confirmed for myself that it
didn't install gem. So i must have done it late one night in a moment
of mental aberration. That makes me believe even more that the op has
a PATH problem.
 
A

andre in LA

I downloaded gems and ran sudo ruby setup.rb which seemed to run OK.

When I run gem, though, I get

sexy-beast:~ user$ gem
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
`initialize': uninitialized constant Gem::CommandManager::HelpCommand
(NameError)
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:46:in
`instance'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run'
from /usr/local/bin/gem:23


any ideas?

..bash_login contains
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

and which gem returns

sexy-beast:~ user$ which gem
/usr/local/bin/gem




Thank you!
-- Andre
 
C

Chris Gehlker

I downloaded gems and ran sudo ruby setup.rb which seemed to run OK.

When I run gem, though, I get

sexy-beast:~ user$ gem
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
`initialize': uninitialized constant Gem::CommandManager::HelpCommand
(NameError)
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:46:in
`instance'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run'
from /usr/local/bin/gem:23

I get:
~ $ gem

RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.

Usage:
gem -h/--help
gem -v/--version
gem command [arguments...] [options...]

Examples:
gem install rake
gem list --local
gem build package.gemspec
gem help install

Further help:
gem help commands list all 'gem' commands
gem help examples show some examples of usage
gem help <COMMAND> show help on COMMAND
(e.g. 'gem help install')
Further information:
http://rubygems.rubyforge.org
.bash_login contains
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:
$PATH"

my PATH is:
~ $ echo $PATH
/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin

which start with '/usr/local/bin' the same as yours.
and which gem returns

sexy-beast:~ user$ which gem
/usr/local/bin/gem

ditto here.

All of which means that I'm totally stumped. Just out of curiosity,
does:
~ $ which ruby
yield
/usr/local/bin/ruby?
 
A

andre in LA

I downloaded gems and ran sudo ruby setup.rb which seemed to run OK.

When I run gem, though, I get

sexy-beast:~ user$ gem
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:52:in
`initialize': uninitialized constant Gem::CommandManager::HelpCommand
(NameError)
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:46:in
`instance'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run'
from /usr/local/bin/gem:23

any ideas?

..bash_login contains
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

and which gem returns

sexy-beast:~ user$ which gem
/usr/local/bin/gem

Thank you!
-- Andre
 
A

andre in LA

which ruby yelds
/usr/local/bin/ruby

the version of ruby is 1.8.4

Thank you in advance
-- Andre
 
C

Chris Gehlker

which ruby yelds
/usr/local/bin/ruby

the version of ruby is 1.8.4

Thank you in advance

Don't thank me for much. If I recall correctly, if you just type
'gem' on the command line you get some kind of error message instead
of a helpful explanation of usage. The thing is that I have exactly
the same setup as you and it just works. Well I'm using ruby 1.8.5
now but it did work when I was on 1.8.4. I installed SWIG to get
Instiki to work but to the best of my recollection gem was working
for me before I did that. You might give it a try. You don't have
anything to loose at this point. <http://www.swig.org/>
Maybe someone more knowledgeable than I will chime in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top