# Method redefined errors from many core ruby libs

**URL:** <https://www.ruby-forum.com/t/method-redefined-errors-from-many-core-ruby-libs/136012>\
**Category:** Rails\
**Created:** [April 28, 2008, 4:44am UTC](https://www.ruby-forum.com/t/method-redefined-errors-from-many-core-ruby-libs/136012 "2008-04-28T04:44:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaven](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e9a140/32.png) [@zaven](https://www.ruby-forum.com/u/zaven)\
**Post date:** [April 28, 2008, 4:44am UTC](https://www.ruby-forum.com/t/method-redefined-errors-from-many-core-ruby-libs/136012/1 "2008-04-28T04:44:57Z")

</div>

I have a Fedora Core 6 system on which I have built ruby 1.8.6 and  
rubygems 1.1.1 from source, and installed rails 2.0.2 using rubygems.  
When I create a new rails app, I get lots of errors that look like  
they’re coming from internal ruby libraries. Lots of methods  
redefined, as if I have some duplicate code somewhere. I also get  
errors when generating a simple model (see below.)

I discovered that I did have duplicate installations of rails-2.0.2  
under /usr/local/lib/ruby/ and /usr/lib64/ruby/. So, I uninstalled all  
the action\* gems and rails, which removed them from /usr/local/, and  
then manually removed everything under /usr/lib64/ruby/gems/1.8/gems/.  
I then reinstalled rails with “gem install rails --include-  
dependencies.” Everything went back into /usr/local/lib/ruby. No  
obvious errors. Next, I created a new rails app. Whoops! Same errors  
as before.

Ideas, please? Also, how can I be sure rails is using the version of  
ruby I think it is?

$ rails --version  
Rails 2.0.2  
$ ruby --version  
ruby 1.8.6 (2007-03-13 patchlevel 0) [x86\_64-linux]  
$ gem --version  
1.1.1

$ ls /usr/local/lib/ruby/gems/1.8/gems/  
actionmailer-2.0.2 activeresource-2.0.2 cgi\_multipart\_eof\_fix-2.5.0  
gem\_plugin-0.2.3 mongrel\_cluster-1.0.5 net-sftp-1.1.1 rake-0.8.1  
actionpack-2.0.2 activesupport-2.0.2 daemons-1.0.10  
highline-1.4.0 mysql-2.7 net-ssh-1.1.2  
activerecord-2.0.2 capistrano-2.2.0 fastthread-1.0.1  
mongrel-1.1.4 needle-1.3.0 rails-2.0.2

$ ls /usr/lib64/ruby/gems/1.8/gems/  
$

For all the lovely errors: click me: [Parked at Loopia](http://pastie.caboo.se/187859)

---

<div class="post-metadata">

**Author:** ![zaven](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e9a140/32.png) [@zaven](https://www.ruby-forum.com/u/zaven)\
**Post date:** [April 28, 2008, 11:21am UTC](https://www.ruby-forum.com/t/method-redefined-errors-from-many-core-ruby-libs/136012/2 "2008-04-28T11:21:02Z")

</div>

On 28 Apr 2008, at 03:44, zaven wrote:

> I have a Fedora Core 6 system on which I have built ruby 1.8.6 and  
> rubygems 1.1.1 from source, and installed rails 2.0.2 using rubygems.

When you build ruby there is an option to say where it should live  
(and I do believe it defaults to /usr/local/lib).  
From an irb prompt you can verify this with  
require ‘rbconfig’  
Config::CONFIG

If you actually have multiple ruby binaries, rails should just end up  
using whatever is on your PATH first.

Fred
