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 6919711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:01:46+00:00 2026-05-27T10:01:46+00:00

In irb: (2**3).class #=> Fixnum (2**3).to_r.class #=> Rational In Textmate: (2**3).class #=> Fixnum (2**3).to_r.class

  • 0

In irb:

(2**3).class #=> Fixnum
(2**3).to_r.class #=> Rational

In Textmate:

(2**3).class #=> Fixnum
(2**3).to_r.class #=> undefined method 'to_r' for 8:Fixnum

Why?

  • 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-27T10:01:47+00:00Added an answer on May 27, 2026 at 10:01 am

    Textmate and irb are using different versions of Ruby. to_r was introduced in 1.9. See:

    1.9.2 (main):0 > 1.to_r
    => (1/1)
    
    1.8.7 (main):0 > 1.to_r
    NoMethodError: undefined method `to_r' for 1:Fixnum
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to extend the Method class along the lines of: irb(main):008:0> class A
Consider the following: irb(main):001:0> class A irb(main):002:1> def initialize irb(main):003:2> @string = my string
In irb, I do this class Text include FileUtils end I get: NameError: uninitialized
how does this work? in irb: >> class A >> b = [1, 2,3]
I fired up irb, and typed: class Point end and then I typed that
Here's my irb session: irb(main):001:0> class User irb(main):002:1> include MongoMapper::Document irb(main):003:1> key :name, String
Why does ruby addition cannot coerce given string to fixnum and vice verca? irb>fixnum
I was testing my code in IRB and I typed in this: class be
I can change the irb prompt mode with irb --prompt prompt-mode I can see
I love using irb to quickly check how my ruby code reacts. Im wondering

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.