# Gem install - will not work outside of bin folder

**URL:** <https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824>\
**Category:** Ruby\
**Created:** [April 29, 2009, 11:10pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824 "2009-04-29T23:10:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 29, 2009, 11:10pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/1 "2009-04-29T23:10:22Z")

</div>

Hi

I just installed ruby 1.8.6 stable version on windows xp pc. When I try  
to install gems by gem install gemname…it says ‘command not  
recognized’. When I download a gem manually and put in the bin folder  
and then use gem install it will work. However, it is only working for  
some gems. Other error messages that I am getting is that the gem is of  
invalid format. Do you know why I can’t run update gems outside of the  
bin folder or why some will not install?

Thanks  
MC

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 29, 2009, 11:16pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/2 "2009-04-29T23:16:27Z")

</div>

On Wed, Apr 29, 2009 at 4:10 PM, Mmcolli00 Mom [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I just installed ruby 1.8.6 stable version on windows xp pc. When I try  
> to install gems by gem install gemname…it says ‘command not  
> recognized’

Make sure that the “ruby\bin” directory is in your PATH.

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 29, 2009, 11:22pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/3 "2009-04-29T23:22:58Z")

</div>

Lyle J. wrote:

> On Wed, Apr 29, 2009 at 4:10 PM, Mmcolli00 Mom [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > I just installed ruby 1.8.6 stable version on windows xp pc. When I try  
> > to install gems by gem install gemname…it says ‘command not  
> > recognized’
> 
> Make sure that the “ruby\bin” directory is in your PATH.

I copied those to the bin and then set my path to ruby\bin. Then I use  
gem install gemname but it says my rake is of invalid format…so I go  
to next gem and use gem install and it says that gem is also of invalid  
format.

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 30, 2009, 3:45pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/4 "2009-04-30T15:45:30Z")

</div>

Thanks Luis… so, you are saying that I can use a commands such as ‘set  
Path’ and ‘gem env’? I didn’t know these were available. Where can I  
find documentation on using these commands and commands like these?

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 30, 2009, 6:45am UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/5 "2009-04-30T06:45:49Z")

</div>

On Apr 29, 6:23 pm, Mmcolli00 Mom [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I copied those to the bin and then set my path to ruby\bin. Then I use  
> gem install gemname but it says my rake is of invalid format…so I go  
> to next gem and use gem install and it says that gem is also of invalid  
> format.

Will be much more helpful than your description that you can provide  
output of:

set PATH  
gem env  
gem install rake

The actual commands and the real output can help us help you.

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 30, 2009, 7:57pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/6 "2009-04-30T19:57:50Z")

</div>

On Apr 30, 10:45 am, Mmcolli00 Mom [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Luis… so, you are saying that I can use a commands such as ‘set  
> Path’ and ‘gem env’? I didn’t know these were available. Where can I  
> find documentation on using these commands and commands like these?

set PATH is abuilt-in command of Windows.

set let you set or unset environment variables. PATH is the  
environment variable that let the system search for executables.

“gem” is the RubyGems executable you use to install, uninstall and  
update gems in your Ruby installation:

[http://docs.rubygems.org/](http://docs.rubygems.org/)

From the command prompt and inside your Ruby\bin directory, execute  
the above mentioned commands and check the output.

If you’re not familiar with the command prompt. I suggest you read  
more documentation how to use it. Similar knowledge acquired here will  
help you on other platforms.

Regards,

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 30, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/7 "2009-04-30T20:00:02Z")

</div>

Ok thanks for the info. - MC

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 30, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/gem-install-will-not-work-outside-of-bin-folder/166824/8 "2009-04-30T20:52:19Z")

</div>

On Apr 30, 2009, at 10:56, Luis L. wrote:

> environment variable that let the system search for executables.  
> more documentation how to use it. Similar knowledge acquired here will  
> help you on other platforms.

also, `gem help` will give help on the gem executable.
