# Require gem problem

**URL:** <https://www.ruby-forum.com/t/require-gem-problem/193641>\
**Category:** Ruby\
**Created:** [August 20, 2010, 11:19pm UTC](https://www.ruby-forum.com/t/require-gem-problem/193641 "2010-08-20T23:19:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalezgjaime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ed655f/32.png) [@gonzalezgjaime](https://www.ruby-forum.com/u/gonzalezgjaime)\
**Post date:** [August 20, 2010, 11:19pm UTC](https://www.ruby-forum.com/t/require-gem-problem/193641/1 "2010-08-20T23:19:08Z")

</div>

Hi to all, i have Ubuntu 10.04 installed, and:

ruby1.9.1-full  
rubygems1.9.1

But i cant require any gems, like in this example:

require ‘rubygems’  
require ‘RedCloth’

For example to use RedCloth i have to add this line to the code:  
require ‘rubygems’  
gem ‘RedCloth’ ←   
require ‘RedCloth’

which is kinda weird, because i have used gems before only with the  
rubygems require, and the gem name require.

This is the error i get when using the first require example:  
LoadError: no such file to load – RedCloth  
from (irb):2:in `require' from (irb):2 from /usr/bin/irb:12:in `’

Now, if i try to use activerecord, i get the same error, but if i add  
the gem line between the rubygems, and gemname requires, i get a  
different error:

Gem::LoadError: Could not find RubyGem active\_record (\>= 0)

from /usr/local/lib/site\_ruby/1.9.1/rubygems.rb:779:in  
`report_activate_error' from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:214:in `activate’  
from /usr/local/lib/site\_ruby/1.9.1/rubygems.rb:1082:in `gem' from (irb):2 from /usr/bin/irb:12:in `’  
Is there something i can do? I have seen various posts on the internet,  
but i have not been able to find the solution.

This is my gem environment

RubyGems Environment:

- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [i486-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-linux

- GEM PATHS:
  - /usr/lib/ruby/gems/1.9.1
  - /home/jaime/.gem/ruby/1.9.1

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://rubygems.org/](http://rubygems.org/)

I have only ruby 1.9.1 installed no other version is installed.

Please help…

Thanks in advanced.

Jaime G…

---

<div class="post-metadata">

**Author:** ![gonzalezgjaime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ed655f/32.png) [@gonzalezgjaime](https://www.ruby-forum.com/u/gonzalezgjaime)\
**Post date:** [August 21, 2010, 9:35pm UTC](https://www.ruby-forum.com/t/require-gem-problem/193641/2 "2010-08-21T21:35:50Z")

</div>

> For example to use RedCloth i have to add this line to the code:  
> require ‘rubygems’  
> gem ‘RedCloth’ ←   
> require ‘RedCloth’

[http://wiki.github.com/rdp/ruby\_tutorials\_core/ruby-talk-faq#gem\_loading\_fails\_191](http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#gem_loading_fails_191)

might help. Worth a try (has instructions on how to avoid using  
gem\_prelude).
