# TypeError when fetching gems with --source

**URL:** <https://www.ruby-forum.com/t/typeerror-when-fetching-gems-with-source/134964>\
**Category:** Ruby\
**Created:** [April 16, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/typeerror-when-fetching-gems-with-source/134964 "2008-04-16T17:30:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [April 16, 2008, 5:30pm UTC](https://www.ruby-forum.com/t/typeerror-when-fetching-gems-with-source/134964/1 "2008-04-16T17:30:14Z")

</div>

When I attempt to fetch gems while specifying a source, like so:

gem fetch activerecord-sqlserver-adapter  
–source=http://gems.rubyonrails.org

…I receive the following error:

ERROR: While executing gem … (TypeError)  
can’t convert URI::HTTP into String

I have tried fetching without specifying the source, which works just  
fine. Suggestions?

---

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [April 16, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/typeerror-when-fetching-gems-with-source/134964/2 "2008-04-16T20:39:50Z")

</div>

Sean Sawyer wrote:

> When I attempt to fetch gems while specifying a source, like so:
> 
> gem fetch activerecord-sqlserver-adapter  
> –source=http://gems.rubyonrails.org
> 
> …I receive the following error:
> 
> ERROR: While executing gem … (TypeError)  
> can’t convert URI::HTTP into String
> 
> I have tried fetching without specifying the source, which works just  
> fine. Suggestions?

Tried this on my Linux machine where of course it works. It’s  
unfortunate that this doesn’t seem to work on Windows, however, since it  
makes it a bit difficult to collect gems for installation on secure  
machines if you can’t fetch from the Rails gem repo.

---

<div class="post-metadata">

**Author:** ![df-sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@df-sean](https://www.ruby-forum.com/u/df-sean)\
**Post date:** [April 16, 2008, 11:10pm UTC](https://www.ruby-forum.com/t/typeerror-when-fetching-gems-with-source/134964/3 "2008-04-16T23:10:43Z")

</div>

On Apr 16, 2008, at 11:39 AM, Sean Sawyer wrote:

> > I have tried fetching without specifying the source, which works just  
> > fine. Suggestions?
> 
> Tried this on my Linux machine where of course it works. It’s  
> unfortunate that this doesn’t seem to work on Windows, however,  
> since it  
> makes it a bit difficult to collect gems for installation on secure  
> machines if you can’t fetch from the Rails gem repo.

`gem env` and `gem --debug fetch ...` will be of help.
