# Require gem problem

**URL:** <https://rubytalk.org/t/require-gem-problem/59725>\
**Category:** ruby-talk\
**Created:** [20 August 2010 21:19 UTC](https://rubytalk.org/t/require-gem-problem/59725 "2010-08-20T21:19:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaime\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@Jaime\_Gonzalez](https://rubytalk.org/u/Jaime_Gonzalez)\
**Post date:** [20 August 2010 21:19 UTC](https://rubytalk.org/t/require-gem-problem/59725/1 "2010-08-20T21:19:13Z")

</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  
&nbsp;&nbsp;from (irb):2:in `require'  
&nbsp;&nbsp;from (irb):2  
&nbsp;&nbsp;from /usr/bin/irb:12:in `\<main\>'

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)

&nbsp;&nbsp;from /usr/local/lib/site\_ruby/1.9.1/rubygems.rb:779:in  
`report\_activate\_error'  
&nbsp;&nbsp;from /usr/local/lib/site\_ruby/1.9.1/rubygems.rb:214:in `activate'  
&nbsp;&nbsp;from /usr/local/lib/site\_ruby/1.9.1/rubygems.rb:1082:in `gem'  
&nbsp;&nbsp;from (irb):2  
&nbsp;&nbsp;from /usr/bin/irb:12:in `\<main\>'  
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:  
&nbsp;&nbsp;- RUBYGEMS VERSION: 1.3.7  
&nbsp;&nbsp;- RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [i486-linux]  
&nbsp;&nbsp;- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.9.1  
&nbsp;&nbsp;- RUBY EXECUTABLE: /usr/bin/ruby1.9.1  
&nbsp;&nbsp;- EXECUTABLE DIRECTORY: /usr/bin  
&nbsp;&nbsp;- RUBYGEMS PLATFORMS:  
&nbsp;&nbsp;&nbsp;&nbsp;- ruby  
&nbsp;&nbsp;&nbsp;&nbsp;- x86-linux  
&nbsp;&nbsp;- GEM PATHS:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- /usr/lib/ruby/gems/1.9.1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- /home/jaime/.gem/ruby/1.9.1  
&nbsp;&nbsp;- GEM CONFIGURATION:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- :update\_sources =\> true  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- :verbose =\> true  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- :benchmark =\> false  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- :backtrace =\> false  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- :bulk\_threshold =\> 1000  
&nbsp;&nbsp;- REMOTE SOURCES:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- [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 Gonzalez.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [21 August 2010 19:35 UTC](https://rubytalk.org/t/require-gem-problem/59725/2 "2010-08-21T19:35:59Z")

</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).

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
