views:

1088

answers:

2

I'm having significant trouble installing Ruby on Rails.

I installed Ruby with apt-get When I tried installing Ruby Gems, the installer consistently hung indefinitely on installing ri, so I tried installing Ruby from source instead. I had the same problem, so I installed Ruby Gems without ri or RDoc. I don't know if this is relevant to the below problem or not.

When I went on to try to install Rails through Gems, I first got an error that Ruby could not find zlib.so... so I copied zlib.so to where Ruby was expecting it to be.

From strace's output, it looked like Ruby was looking in

/usr/local/lib/ruby/1.8/x86_64-linux/zlib.so

but zlib.so was only located at

/usr/lib/ruby/1.8/x86_64-linux/zlib.so

Now I'm getting a new error:

    ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
        SocketError: getaddrinfo: Name or service not known (http://gems.rubyforge.org/gems/actionmailer-2.2.2.gem)

I have a feeling something is deeply wrong is going on. What can I do to ameliorate this error?

A: 

With respect to the getaddrinfo error, this could mean that your machine cannot resolve localhost, or its hostname. It might be worth checking your /etc/hosts file for completion. If my machine's hostname was bob and my fully qualified domain name was example.com, i would be checking for the following entry:

127.0.0.1    example.com bob
deizel
+3  A: 

I just had this problem myself, and discovered this site: http://www.typeoneerror.com/updating-rails-error/

Which recommends using the -p switch (it worked for me for both install and update commands).

I don't see how or why (maybe someone else can explain it?), but it did work for me. Sometimes, if it fails, just try running it again, it seems to get past it after a second try at a particular gem.

Groxx
Thank you kindly. This worked for me.
Thanks for the link up! There needs to be a system for helpful links upvoting the user if they are a user on stackoverflow ;)
Typeoneerror