Jun 30 2008

How to work around the “no address associated with hostname.(SocketError)” when installing Rails

If you're new here, you may want to start with my most popular posts. Then, subscribe to my RSS feed to stay updated. Thanks for visiting!

Google Query: gem install rails no address associated with hostname.(SocketError)

I was trying to install Rails the other day at work and they had just finished implementing some “new improved” firewall security rules. Well needless to say, this broke my ability to install Rails. Although, I didn’t realize this at first. I kept getting the following error when I tried to install Rails:

ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
getaddrinfo: no address associated with hostname.(SocketError)

After some investigating, it turned out that some ports were being blocked on the firewall that did not allow me to install Ruby gems directly from the repository with the gem command. After some googling, I found the easiest solution at Ashish Kulkarni’s Blog. Thanks Ashish!

Basically you do the following:

-Go to the rubyforge gems subdirectory and download the following:

  1. activesupport
  2. activerecord
  3. actionwebservice
  4. actionpack
  5. actionmailer
  6. rails

-Now go to your command prompt and change to the directory where you downloaded the gems and execute the following:

  1. gem install activesupport
  2. gem install activerecord
  3. gem install actionwebservice
  4. gem install actionpack
  5. gem install actionmailer
  6. gem install rails

That’s it! Now when you are behind a pesky firewall and get this error, you can work around it! Happy Coding!

Technorati Tags: , , ,

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

LEAVE A COMMENT

Subscribe Form

Subscribe to Blog

Sponsors

Recent Readers

JOIN MY COMMUNITY!
                  Computers Blogs - Blog Top Sites