Sunday, December 09, 2007

Ruby on Rails install headaches

Some problems installing ruby on rails that I thought I's document.

Firstly I followed the instructions on rubyonrails.org, downloading the altest version of ruby 1.86_25, downloading and installing ruby Gems. The the next step where you actually install rails is where the trouble started

C:\apps\ruby186.25\rubygems-0.9.5>gem install rails --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Bad file descriptor - connect(2) (Errno::EBADF)


First problem was web proxys.

My laptop is used both in work and at home. In work I use a http proxy to access the web. At home I don't. The problem was I had set a system variable to set a http proxy variable. (http_proxy), but I was using my laptop at home.

To check if you use a http proxy from a DOS window type the following

echo %http_proxy%

If you get a response like
http://10.105.24.70:8080

then you have a http proxy set.

For me I had to remove the proxy. This is done by
set http_proxy=

For most people however I would imagine the problem is the opposite, you may need to set the http_proxy for your DOS window. To check if you need a http_proxy, goto your web browser

For IE
Tools/ Internet Options/ Connections/ LAN Settings/ Proxy Server
Note the url and port

For Firefox goto
Tools/ Options/ Advanced/ Network tab/ Settings (phew)
Note the url and port

You can set the proxy in the dos window simply by typing
set http_proxy=http://10.105.24.70:8080

With this done you should be able to retry the install

Next problem was

C:\apps\ruby186.25\rubygems-0.9.5>gem install rails --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
OpenURI::HTTPError: 404 Not Found reading http://gems.rubyforge.org/gems/activesupport-2.0.1.gem


THis was a temporary problem. I inserted the url into a browser and it worked. When I retried the command it also worked.

9 comments:

Rich said...

A MAC with Leopard will solve all problems

Anonymous said...

Hello.

I saw your post about RoR install headaches and thought to drop you a line.

Have you heard of FiveRuns? We are a new systems management vendor that is focused on performance profiling, event notification, monitoring and reporting of Rails applications. I am looking for folks in the industry to give us some feedback on how we are doing as we get things off the ground.

If you are interested, I would like to invite you to a 30 day trial of our service. Here's a link to learn more - www.fiveruns.com. We'd love to get your thoughts.

Thanks for your time.

Greg Willis
FiveRuns
512-342-6363
greg@fiveruns.com

dericbytes said...

Thanks : )

I am using a wireless network at home. I set the environment variable like you said and it worked.

# Cygwin Setup
export HTTP_PROXY=192.168.0.1

dericbytes said...

The INFO message

INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list

means don't add --add-dependencies because it is already added by default, and if you want the opposite then you can always add
--ignore-dependencies

dericbytes said...

I did'nt have any HTTP_PROXY data in my web browser settings, but still need to set the HTTP_PROXY environment variable.

Anonymous said...

thanks for the http_proxy info. it helped a lot. nice complete explanations are rare so i really appreciated the terse==no cryptic==no lazy==no setting in your post.

thanks again

-wyderp

Rich Reuter said...

Thanks very much for posting this. Very helpful.

Anonymous said...

This was great but when I ran the proxy I got a 407 austhenitcation needed error. I altered the proxy statement to

set http_proxy=http://username:password@10.105.24.70:8080

and then it worked fine.

Thanks

Boobalan said...

Hi,
i got the following and could not proceed

Need to update 1 gems from http://gems.rubyforge.org
.
complete
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find rails (= 2.3.2) in any repository