Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6594253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:47:13+00:00 2026-05-25T17:47:13+00:00

I want to use the ruby-units with a rails 3 project, but it seems

  • 0

I want to use the ruby-units with a rails 3 project, but it seems like it conflicts with activesupport.

It looks to me like both activesupport and ruby-units create a to() method for String. For some reason, ruby-units one wins, and so whenever to() is called inside rails it throws an error. (Unit not recognized)

I want to know the best way to deal with this. I don’t care about having the to() method from ruby-units, I just don’t want it to interfere with rails. I’d like to avoid forking if there’s another approach.

To see my problem:

Add to your gemfile

gem 'ruby-units'

Open up rails console (I’m on rails 3 with ruby 1.9.2) and try apples.to(1)

Without ruby-units:

"ap"

With:

"'apples' Unit not recognized"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:47:13+00:00Added an answer on May 25, 2026 at 5:47 pm

    The answer to this is to require the ruby-units library before the rails library in the Gemfile:

    gem 'ruby-units'
    gem 'rails'
    

    Obviously you then won’t be able to use .to() on strings to access the ruby-units conversion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like it is in many newsletter services, I want to use Ruby on Rails
Hi I'm want to use ruby on rails to create a facebook connect web
it's about Ruby On Rails. I want to use Googleauth and need to add
I want to use Ruby/Mikel Mail gem to access pop3, but am stuck finding
I've tried many solutions but nothing seems to work! I use Ruby 1.9.3 and
I want to use Resque in a Ruby on Rails application. I have no
I am running my rails 3 project under ruby 1.9.2 with rvm. I use
I'd like to profile my JRuby app. For MRI I always use ruby-prof, but
I want to write a web application and want to use Ruby. I have
I want to use modal pop-up windows in our web app in Ruby on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.