# Cygwin: no such file to load -- ubygem

**URL:** <https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144>\
**Category:** Ruby\
**Created:** [May 14, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144 "2007-05-14T18:37:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [May 14, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144/1 "2007-05-14T18:37:31Z")

</div>

I now have - thanks to the help of many readers of this mailing list -  
installed  
Ruby 1.8.5 and gem 0.9.3 for both Cygwin and Windows.

Under Cygwin, however, ruby doesn’t seem to make use of the installed  
gems:

~/tmp $ ruby -rubygem t2.rb  
ruby: no such file to load – ubygem (LoadError)

Under pure Windows, it works fine.

Any idea why this happens? Note that under Cygwin, I use the Ruby  
version  
which I can load via the Cygwin setup program.

Ronald

---

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [May 14, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144/2 "2007-05-14T18:43:32Z")

</div>

missing “s” rubygems

---

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [May 14, 2007, 11:28pm UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144/3 "2007-05-14T23:28:19Z")

</div>

I had that problem too. I don’t quite remember how I fixed it, but I  
think I found this page:

[http://blog.labnotes.org/2005/11/06/setting-up-ruby-gems-on-cygwin/](http://blog.labnotes.org/2005/11/06/setting-up-ruby-gems-on-cygwin/)

He says that he experienced the problem, and he thinks it’s because he  
had both the one-click installer and cygwin (I have this same setup at  
work – both one-click installer and cygwin). He didn’t dig too much  
into it, though, he just installed rubygems manually. I think this is  
what I did, too, but I’m not sure.

To install rubygems without a working rubygem setup:

- Follow the link on his blog to rubygems
- Download the latest tarball (.tar.gz)
- Unpack the tarball using cygwin or 7-zip
- Run “ruby setup.rb install” inside the directory

I think it’s a pure ruby package (no C code) so you shouldn’t need  
anything extra to install it. Once you’ve installed it, you should  
hopefully be able to use gems.

Ben

---

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [May 15, 2007, 12:50am UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144/4 "2007-05-15T00:50:31Z")

</div>

I looked and I found “ubygems.rb” in /usr/lib/ruby/site\_ruby/1.8/.  
Interesting. That is a bit of a trick.

Most people will probably want to do what I did and install rubygems  
from the tarball, though, since pretty much all ruby users use gems.  
I’m not sure whether rubygems is missing or if it doesn’t have the  
normal configuration when cygwin is first installed with the ruby  
package, but either way, it’s not the ideal configuration for most  
ruby users, and it can be fixed by unpacking the tarball and  
installing rubygems.

Ben

---

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [May 15, 2007, 11:53am UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144/5 "2007-05-15T11:53:45Z")

</div>

> missing “s” rubygems

Thank you - that was it! Stupid me!!

Ronald

---

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [May 15, 2007, 12:26am UTC](https://www.ruby-forum.com/t/cygwin-no-such-file-to-load-ubygem/104144/6 "2007-05-15T00:26:29Z")

</div>

The O.-Click installer sets the environment variable RUBYOPT to the  
value “rubygems” to automatically require the the RubyGems package  
(this is a bit of a trick since the “r” is the require option, and the  
file being required is named “ubygems.rb”.

Anyway, if you get rid of the RUBYOPT variable it should fix your  
problem.

Curt
