RubyGems setup

A

alex_land

Hi:

I have tried everything i can think of to install RubyGems, but no
success. I would be grateful for any assistance. In sum, my problem
is that i can't install the Gems' System (so obviously my problem is
not with a particular library/Gem-i haven't got that far yet).

Here are the details:

1. My rig: a MacBook Core 2 Duo; It's my personal Mac and i have the
admin password.

2. version of Ruby i'm running (v. 1.82)

3. What i've done: went to rubyforge, downloaded and upacked 0.9.4
RubyGems (tried one prior release just in case, same result)

4. tried to do an install from my Terminal (% ruby setup.rb <--that's
hat the readme file says to do, and indeed, that file is in the
distribution.

5. I know the install failed because none of the *gem* commands work
from my Terminal (e.g., "gem help).

6. Here's my Terminal window output i got when i tried to run the
setup file (which i'll copy in tedious detail in case some small piece
of this is the key):

---> bin
<--- bin
---> lib
---> lib/rbconfig
<--- lib/rbconfig
---> lib/rubygems
---> lib/rubygems/commands
<--- lib/rubygems/commands
---> lib/rubygems/digest
<--- lib/rubygems/digest
<--- lib/rubygems
<--- lib
---> bin
<--- bin
---> lib
---> lib/rbconfig
<--- lib/rbconfig
---> lib/rubygems
---> lib/rubygems/commands
<--- lib/rubygems/commands
---> lib/rubygems/digest
<--- lib/rubygems/digest
<--- lib/rubygems
<--- lib
rm -f InstalledFiles
---> bin
mkdir -p /usr/bin/
install gem /usr/bin/
setup.rb:633:in `initialize': Permission denied - /usr/bin/gem
(Errno::EACCES)
from setup.rb:633:in `open'
from setup.rb:633:in `install'
from setup.rb:1377:in `install_files'
from setup.rb:1376:in `each'
from setup.rb:1376:in `install_files'
from setup.rb:1346:in `install_dir_bin'
from setup.rb:1532:in `__send__'
from setup.rb:1532:in `traverse'
... 6 levels...
from setup.rb:1000:in `exec_install'
from setup.rb:814:in `invoke'
from setup.rb:773:in `invoke'
from setup.rb:1578


7. I used, i think, Macaroni or something similar to repair my
permissions (did this several times), then tried to re-install, same
result.


Thanks,

-Alex
 
A

Anupam Sengupta

Alex> Hi: I have tried everything i can think of to install RubyGems, but no
Alex> success. I would be grateful for any assistance. In sum, my problem
Alex> is that i can't install the Gems' System (so obviously my problem is
Alex> not with a particular library/Gem-i haven't got that far yet).

Alex> 1. My rig: a MacBook Core 2 Duo; It's my personal Mac and i have the
Alex> admin password.

That is good. You will need the admin password for 'sudo' to install the
rubygems install.

Alex> 2. version of Ruby i'm running (v. 1.82)

This version of Ruby *should* work. Later upto date versions are available at
Darwinports though (see the link below):

http://darwinports.com/

Alex> 3. What i've done: went to rubyforge, downloaded and upacked 0.9.4
Alex> RubyGems (tried one prior release just in case, same result)

Use the latest version.

Alex> 4. tried to do an install from my Terminal (% ruby setup.rb <--that's
Alex> hat the readme file says to do, and indeed, that file is in the
Alex> distribution.

That is correct. However, you need to install as root (via sudo).


[...]


Alex> 6. Here's my Terminal window output i got when i tried to run the
Alex> setup file (which i'll copy in tedious detail in case some small piece
Alex> of this is the key):


[...]


Alex> mkdir -p /usr/bin/ install gem
Alex> /usr/bin/ setup.rb:633:in `initialize':
Alex> Permission denied - /usr/bin/gem (Errno::EACCES) from setup.rb:633:in
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^

This says it all. You were trying to install using your normal user ID; you will
need a root ID (i.e., the 'Admin' user ID) to install the ruby gems system.

So, instead of typing the following in terminal:

ruby setup.rb

Do this:

sudo ruby setup.rb

and provide the admin password when the password prompt comes up.

[...]

Alex> 7. I used, i think, Macaroni or something similar to repair my
Alex> permissions (did this several times), then tried to re-install, same
Alex> result.

Your system permissions are fine. This was an access level issue.

HTH,
 
A

alex_land

Alex> Hi: I have tried everything i can think of to install RubyGems, but no
Alex> success. I would be grateful for any assistance. In sum, my problem
Alex> is that i can't install the Gems' System (so obviously my problem is
Alex> not with a particular library/Gem-i haven't got that far yet).

Alex> 1. My rig: a MacBook Core 2 Duo; It's my personal Mac and i have the
Alex> admin password.

That is good. You will need the admin password for 'sudo' to install the
rubygems install.

Alex> 2. version of Ruby i'm running (v. 1.82)

This version of Ruby *should* work. Later upto date versions are available at
Darwinports though (see the link below):

http://darwinports.com/

Alex> 3. What i've done: went to rubyforge, downloaded and upacked 0.9.4
Alex> RubyGems (tried one prior release just in case, same result)

Use the latest version.

Alex> 4. tried to do an install from my Terminal (% ruby setup.rb <--that's
Alex> hat the readme file says to do, and indeed, that file is in the
Alex> distribution.

That is correct. However, you need to install as root (via sudo).

[...]

Alex> 6. Here's my Terminal window output i got when i tried to run the
Alex> setup file (which i'll copy in tedious detail in case some small piece
Alex> of this is the key):

[...]

Alex> mkdir -p /usr/bin/ install gem
Alex> /usr/bin/ setup.rb:633:in `initialize':
Alex> Permission denied - /usr/bin/gem (Errno::EACCES) from setup.rb:633:in
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^

This says it all. You were trying to install using your normal user ID; you will
need a root ID (i.e., the 'Admin' user ID) to install the ruby gems system.

So, instead of typing the following in terminal:

ruby setup.rb

Do this:

sudo ruby setup.rb

and provide the admin password when the password prompt comes up.

[...]

Alex> 7. I used, i think, Macaroni or something similar to repair my
Alex> permissions (did this several times), then tried to re-install, same
Alex> result.

Your system permissions are fine. This was an access level issue.

HTH,

Hello Anupam:


Yes that worked immediately, thanks! (it also worked when i just
installed a few libraries via R/G, e.g., Mechanize).

Regards,

-Alex
 

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,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top