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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:23:41+00:00 2026-06-01T21:23:41+00:00

When executing a command like y Grau.all in rails console I am getting these

  • 0

When executing a command like y Grau.all in rails console I am getting these strange !binary strings instead of the attribute’s name. Any idea how to fix this?

Thanks.

irb(main):003:0> y Grau.all
  ←[1m←[36mGrau Load (0.0ms)←[0m  ←[1mSELECT "graus".* FROM "gr
  ←[1m←[35mEXPLAIN (0.0ms)←[0m  EXPLAIN QUERY PLAN SELECT "grau

EXPLAIN for: SELECT "graus".* FROM "graus"
0|0|0|SCAN TABLE graus (~1000000 rows)

---
- !ruby/object:Grau
  attributes:
    !binary "aWQ=": 27
    !binary "bm9tZQ==": 1 Grau
    !binary "Y3JlYXRlZF9hdA==": 2012-04-06 21:24:34.553163000 Z
    !binary "dXBkYXRlZF9hdA==": 2012-04-06 21:24:34.553163000 Z
- !ruby/object:Grau
  attributes:
    !binary "aWQ=": 28
    !binary "bm9tZQ==": 2 Grau
    !binary "Y3JlYXRlZF9hdA==": 2012-04-06 21:24:34.599963000 Z
    !binary "dXBkYXRlZF9hdA==": 2012-04-06 21:24:34.599963000 Z

[UPDATES]

irb(main):001:0> Grau.find(1)
  ←[1m←[36mGrau Load (43.8ms)←[0m  ←[1mSELECT "graus".* FROM "graus" WHERE "grau
s"."id" = ? LIMIT 1←[0m  [["id", 1]]
=> #<Grau id: 1, nome: "1º Grau", created_at: "2012-04-11 15:51:32", updated_at:
 "2012-04-11 15:51:32">
irb(main):002:0>

I am using Rails 3.2.3, Ruby 1.9.3 on a Windows 7 64 bit.

  • 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-06-01T21:23:42+00:00Added an answer on June 1, 2026 at 9:23 pm

    It appears to be because rails defaults to using the newer psych YAML engine, the older syck yaml engine doesn’t output the !binary keys. If you’re just wanting it for testing in the console you can switch back to the older yaml engine as a temp workaround:

     > y User.first
      User Load (0.0ms)  SELECT "users".* FROM "users" LIMIT 1
    --- !ruby/object:User
    attributes:
      !binary "aWQ=": 1
      !binary "bmFtZQ==": Example User
      !binary "ZW1haWw=": user@example.com
    
     > YAML::ENGINE.yamler= 'syck'
    => "syck"
    
     > y User.first
      User Load (1.0ms)  SELECT "users".* FROM "users" LIMIT 1
    --- !ruby/object:User
    attributes:
      id: 1
      name: Example User
      email: user@example.com
    

    You would only need to do this when your ActiveRecord column names/attributes keys are encoded using Encoding::ASCII_8BIT which I think only happens with SQLite.


    Update:

    Since posting this answer the SQLite3 gem has been fixed to return utf8 for column names. Make sure you’re using version 1.3.6 (or higher) of the sqlite3 gem. Then the default/newer psych yaml engine (which also supports human-readable unicode output) will work without problems:

     > y User.first
      User Load (0.0ms)  SELECT "users".* FROM "users" LIMIT 1
      EXPLAIN (0.0ms)  EXPLAIN QUERY PLAN SELECT "users".* FROM "users" LIMIT 1
    EXPLAIN for: SELECT  "users".* FROM "users"  LIMIT 1
    0|0|0|SCAN TABLE users (~1000000 rows)
    
    --- !ruby/object:User
    attributes:
      id: 1
      name: irmão
      email: user@example.com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need something like make i.e. dependencies + executing shell commands where failing command
In Bash I'm executing a command and putting the result in a variable like
I am executing a command in a thread for almost 25k times like if
I often find myself executing commands like this at bash : history | grep
I'm currently facing a weird problem while executing a command from my bash script.
I know that SqlContext.WindowsIdentity returns the current user that is executing the command (in
I have an awesome trouble with Gem. After executing this command: rm -f /usr/local/lib/ruby/gems/1.9.1/cache/*
I´m executing the following command grep bruno < bash.txt which gives me the right
I cannot get the example Python programs to run. When executing the Python command
Say I have a command line C program which is currently executing, and I

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.