Require gem problem

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:inactivate’
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:

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

Please help…

Thanks in advanced.

Jaime G…

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

might help. Worth a try (has instructions on how to avoid using
gem_prelude).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs