# method redefined errors from many core ruby libs

**URL:** <https://discuss.rubyonrails.org/t/method-redefined-errors-from-many-core-ruby-libs/28639>\
**Category:** rubyonrails-talk\
**Created:** [April 28, 2008, 2:44am UTC](https://discuss.rubyonrails.org/t/method-redefined-errors-from-many-core-ruby-libs/28639 "2008-04-28T02:44:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaven](https://avatars.discourse-cdn.com/v4/letter/z/e9a140/32.png) [@zaven](https://discuss.rubyonrails.org/u/zaven)\
**Post date:** [April 28, 2008, 2:44am UTC](https://discuss.rubyonrails.org/t/method-redefined-errors-from-many-core-ruby-libs/28639/1 "2008-04-28T02:44:21Z")

</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:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [April 28, 2008, 9:20am UTC](https://discuss.rubyonrails.org/t/method-redefined-errors-from-many-core-ruby-libs/28639/2 "2008-04-28T09:20:08Z")

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