irb Questions

1

Solved

https://ruby-doc.org/stdlib-2.6.3/libdoc/tmpdir/rdoc/Dir.html contains a description about the mktmpdir method of the Dir class. mktmpdir(prefix_suffix=nil, *rest) ::mktmpdir creates a temporary d...
Nomenclator asked 21/9, 2019 at 0:58

8

I am using IRB (interactive ruby console) to learn how to program with Ruby. How do I load a file into the console if I write my programs in a text editor first?
Needlework asked 28/10, 2012 at 19:30

6

Solved

I just installed ruby 1.9.2 on windows machine and Backspace or any other arrow keys don't work. This happens only when I open IRB on Git Bash console. But it works fine on Windows console. Any hel...
Emend asked 14/4, 2011 at 7:59

6

Solved

Say I am running IRB and I type this into the console: def full_name(first, last) puts "Your full name is: #{first, ' ', last}" end Say, that I wanted to edit that to include the parameter midd...
Uniformize asked 12/3, 2012 at 22:58

3

I am starting out with Ruby on Rails. I am currently going through a tutorial that says that I have to run a .rb file from IRB to create a .xml file in my current directory. My question is how do I...
Pinkston asked 27/5, 2011 at 8:46

12

Solved

I want to get something like this to look nice: >> ProductColor.all => [#<ProductColor id: 1, name: "White", internal_name: "White", created_at: "2009-06-10 04:02:44", updated_at: "200...
Outstand asked 3/8, 2009 at 20:43

3

Solved

If you change a file then re-load it in pry or irb, it seems to pick up any NEW functionality you've added to that class, but doesn't forget about OLD functionality you've deleted from that class. ...
Deathbed asked 22/11, 2014 at 3:5

4

Solved

An example is if I go into IRB and do the following: jruby-1.6.7 :026 > puts [1,2,3,4,5] 1 2 3 4 5 => nil Is there anyway to suppress the nil? The problem is if I put in a large data stru...
Officiate asked 14/4, 2012 at 2:32

3

Solved

I'm pretty tired of writing this line every time I want to open the Rails console: irb(main):001:0> ActsAsTenant.current_tenant = User.find(1).account Is there any way to run command/script b...
Gymnasiarch asked 3/3, 2016 at 12:46

2

Solved

When I run rails c and press the up key when irb starts up, I can see the last commands I entered when my app dropped to irb after encountering a debugger command for the ruby-debug gem. I would no...
Tranquilizer asked 10/12, 2010 at 19:11

9

Solved

In the python world, there are a number of alternative python interpreters that add cool additional features. One particularly useful example is bpython, which adds dynamic syntax highlighting, aut...
Dastard asked 7/10, 2010 at 18:33

2

Why is my irb history no longer saving?
Cupel asked 17/11, 2009 at 22:55

3

Solved

I think this is a little, easy question! I'm using .env file to keep all my environment variables, and i'm using foreman. Unfortunately, these environment variables are not being loaded when runn...
Agent asked 12/3, 2013 at 19:52

3

Solved

I'm using Ubuntu Server 10 lucid, ruby 1.9.2-p0. In irb, the left arrow shows ^[[D. Any idea?
Gentille asked 27/12, 2011 at 7:57

6

Solved

Can I drop to an IRB prompt from a running Ruby script? I want to run a script, but then have it give me an IRB prompt at a point in the program with the current state of the program, but not just...
Thrasonical asked 17/7, 2009 at 17:7

2

Solved

I'm running into something weird here. I have an "authenticator" that relies on ND5 to hash a certain string we match as password. The problem when I run my tests is this: NoMethodError: undefined...
Unattached asked 23/8, 2012 at 10:38

6

Solved

I'm running Ruby on Windows though I don't know if that should make a difference. All I want to do is get the current working directory's absolute path. Is this possible from irb? Apparently from a...
Edric asked 21/12, 2009 at 1:23

4

Solved

I am experiencing very strange behavior in Ruby 1.9.3's IRB with Mac OS 10.7.3 When I try to enter an Umlaut, it's escaped in the prompt and looks like this (I entered "ü" on the keyboard) irb(mai...
Rhaetic asked 30/4, 2012 at 15:7

5

Solved

I'm trying to write a rake task that will set up an environment mirroring my project. task :environment do require 'rubygems' require 'sequel' # require 'my_projects_special_files' end task :...
Okapi asked 21/4, 2010 at 14:33

2

Solved

Just curious about it. If you open the IRB and type _, you'll get nil as response: irb(main):001:0> _ => nil And you can modify its value: irb(main):002:0> _ = 'some value' irb(main):...
Raeraeann asked 4/1, 2017 at 19:57

8

Solved

Is there an easy way to repeat a previous command in Ruby irb? I wish to have something like using exclamation mark (!) in Unix. Thank you.
Skeet asked 1/6, 2012 at 10:39

4

Solved

I have a string str = "xyz\123" and I want to print it as is. The IRB is giving me an unexpected output. Please find the same below:- 1.9.2p290 :003 > str = "xyz\123" => "xyzS" 1.9.2p290 ...
Wensleydale asked 10/4, 2012 at 4:53

1

Solved

Using the code below: variable = puts "hello world".upcase Why does Ruby automatically puts Hello world in upcase, without the variable first being invoked? I understand that you are setting the...
Marquet asked 31/10, 2016 at 19:17

2

Solved

This is a long standing source of frustration, but maybe there is something I'm missing. If i'm in the middle of debugging, and I want to exit the debugger and return to IRB or Rails Console, "quit...
Clava asked 12/11, 2011 at 18:2

21

Solved

How do you clear the IRB console screen?
Dirndl asked 22/9, 2008 at 18:24

© 2022 - 2024 — McMap. All rights reserved.