irb Questions

2

Solved

irb can write command history to a file, but it only does this when your irb session ends. I would like to write out my command history more frequently: as often as on every command (like shell hi...
Psittacine asked 18/11, 2010 at 19:54

2

Solved

In my .irbrc file I require 'logger' to allow me to see the SQL executed when querying ActiveRecords all while in the script/console. My question is, how do I temporarily turn off the logger so it...
Perpetual asked 5/11, 2010 at 2:45

2

Solved

How can I execute a image_tag method in a Rails console Run the console $ rails c Load helpers include ActionView::Helpers Execute the command image_tag('test.png') I got a strange erro...
Ectophyte asked 4/11, 2010 at 20:16

1

Solved

Using Rails3 and Ruby 1.9.2, I am new, just learning Ruby/Rails-- When I run irb I end up with irb(main):001:0> which is fine. However when I run rails console I also end up with irb(main):001...
Dell asked 30/10, 2010 at 0:56

3

Solved

What is the easiest way to return an array in random order in Ruby? Anything that is nice and short that can be used in an IRB session like [1,2,3,4,5].random() # or random_sort([1,2,3,4,5])
Quill asked 12/8, 2010 at 14:19

1

Solved

I want to display few active records in rails console, I have Hirb enabled. The table is narrow enough to be displayed (so Hirb uses standard, horizontal table) but columns are so narrow that conte...
Credible asked 11/8, 2010 at 11:57

3

Solved

Is there a way to "reload" or "refresh" a rubygem in memory? As i'm playing in irb, occasionally I like to modify my gem files, and if i require the same gem, it does not update into memory and giv...
Bernadine asked 11/8, 2010 at 21:58

5

Solved

As I am going through my journey by adopting the Ruby language, I spend a lot of time inside IRb. It's just fantastic! But, as I am not very aware of it's capabilities, and still a “nubby” with Rub...
Vish asked 16/4, 2010 at 11:32

1

Solved

What do these errors mean? [root@localhost config]# gem install bluecloth Building native extensions. This could take a while... ERROR: Error installing bluecloth: ERROR: Failed to build gem nati...
Sapphism asked 25/5, 2010 at 12:36

4

Solved

The file welcome.rb contains: welcome_message = "hi there" But in IRB, I can't access the variable I just created: require './welcome.rb' puts welcome_message # => undefined local variabl...
Ammonium asked 23/4, 2010 at 14:27

4

Solved

For instance, in Python, I can do things like this if I want to get all attributes on an object: >>> import sys >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__n...
Weissberg asked 22/3, 2010 at 13:57

2

Solved

I have a Ruby script that defines a class. I would like the script to execute the statement BoolParser.generate :file_base=>'bool_parser' only when the script is invoked as an executable, not...
Dublin asked 9/2, 2010 at 5:34

2

Solved

My version of ruby was compiled with editline (on os x) and I miss the features of readline in irb. How do I recompile ruby with readline support?
Aslant asked 23/11, 2009 at 7:4

2

Solved

I'm fairly new to ruby, and am configuring IRB. I like pretty print (require 'pp'), but it seems a hassle to always type pp for it to pretty print it. What I'd like to do is make it pretty print by...
Nevis asked 13/11, 2009 at 20:48

1

Solved

When I run a Rails app it finds all of my installed gems correctly. This is the first time I tried to call some gems from inside irb and it couldn't find them. blocke:~$ irb irb(main):001:0> r...
Graybeard asked 6/11, 2009 at 19:19

5

Solved

How can I copy and paste in irb (Interactive Ruby Shell) on Windows?
Pau asked 28/9, 2008 at 1:38

5

Solved

I am trying to find a better way to integrate IRB with my normal ruby devleopment. Currently I rarely use IRB with my code. I only use it to verify syntax or to try something small. I know I can ...
Ascariasis asked 27/9, 2008 at 17:17

© 2022 - 2024 — McMap. All rights reserved.