I am trying to use the RedCloth gem in my rails project. When I used irb
I can load the gem:
require 'rubygems'
require 'RedCloth'
and it works fine, but when I try the same thing in the rails console I get an error message stating that the gem cannot be found.
Does anyone have any idea what might cause this?
You can append gem path to ruby load path. Do this:
gem which faker
=> /usr/local/ruby/......../faker-0.1.1/lib/faker.rb
Start Rails console and do the following:
$: << '/usr/local/ruby/......../faker-0.1.1/lib/'
and now load faker gem
require 'faker'
=> true
Does your rails project's Gemfile
include gem 'RedCloth'
in it? Rails will only load the gems specified in that file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With