Questions tagged [pry]

Pry is an alternative to the standard Ruby interpreter, IRB.

Pry is an REPL (Read Eval Print Loop) interpreter, allowing to access the source code and the documentation, edit methods and execute shell commands.

http://pry.github.com/

459 questions
0
votes
1 answer

Rspec model test with Fabricator & let(...) format. Console shows no data in databse but there is.

I don't understand why it returns empty when I type "Video.all" first time in console after it did not pass the test, but if I specify them like "video" & "video2", and then I type "Video.all" it correctly returns the 2 videos. Does anyone know why…
YHDEV
  • 477
  • 8
  • 22
0
votes
2 answers

Send an object using pry?

I am trying to send an object (user) to NotificationsMailer like this: pry(main)>NotificationsMailer.welcome_facebook_user({:password=>'123',:email=>'as453now@gmail.com',:basic_profile=>{:name=>'Samir'}}).deliver But I got this…
simo
  • 23,342
  • 38
  • 121
  • 218
0
votes
1 answer

factory girl nested attributes

In rails console,I run this command bill = Bill.last bill.bill_extras The result is like that. [#, created_at: "2012-08-02 04:48:12",…
Johnny Cash
  • 4,867
  • 5
  • 21
  • 37
0
votes
1 answer

pry not available in the irb debugger

I want to use pry from within irb/debugger, so I can: invoke step, next, continue, finish inside of pry still be able to set breakpoints, etc. What I did is the following: $ gem install pry $ gem install debugger $ gem install debugger-pry In the…
RevMoon
  • 859
  • 1
  • 9
  • 16
0
votes
3 answers

Assigning an exception to a variable in pry

So I'm trying to use pry to debug a method_missing in my Rails app and am getting a: [5] pry(#)> puts e NameError: undefined local variable or method `e' for # Here's my code 21:…
ovatsug25
  • 7,786
  • 7
  • 34
  • 48
0
votes
2 answers

Does pry or irb allow you to work interactively from inside a block?

I know that pry allows you to "cd" into other scopes. pry(main)> cd Object pry(Object)> ls constants: ARGF Encoding GC NIL ArgumentError EncodingError Gem NilClass …
DragonFax
  • 4,625
  • 2
  • 32
  • 35
0
votes
1 answer

Launching Pry on the command line errors out

So this is what i get when I launch the pry command at my Zsh. I've tried reinstalling using rvm reinstall 1.9.3 rvm repair all and even rvm reinstall all --force At a loss as to how to get rid of…
Tushar S
  • 352
  • 1
  • 6
  • 15
0
votes
2 answers

pry: artifacts on ctrl-arrow (ubuntu)

I installed ruby using rvm and I use it in a RoR project. the problem is that when I start pry inside that project, I'm not able to use ctrl-arrows shortcuts> Instead of getting a word left/right, it prints artifacts, like ;5D or ;5C. When I call…
mrzasa
  • 22,895
  • 11
  • 56
  • 94
0
votes
1 answer

How to paginate awesome_print results inside pry

I'm using awesome_print gem to display output from pry to look pretty. Since, awesome_print uses line breaks, long outputs like ap html.chapters.order("position ASC") only shows the end part of the output, How Do I paginate the result to look like…
Sathish Manohar
  • 5,859
  • 10
  • 37
  • 47
0
votes
2 answers

How do I customize Pry's .pryrc file?

I'm trying to customize pry's pryrc file, but I can't find it. The docs say that it's in the home directory, but I don't see it in there. If it's invisible, can tell me how to edit it despite that fact?
BrainLikeADullPencil
  • 11,313
  • 24
  • 78
  • 134
0
votes
1 answer

run minitest programmatically

I've got this code (in pry): class Hash def invert_by_array each.with_object({}) {|(key,value), obj| value.each do |element| obj[element] = key end } end end require 'minitest/spec' describe "invert_by_array" do …
Reactormonk
  • 21,472
  • 14
  • 74
  • 123
0
votes
1 answer

Nokogiri cannot exit opening a url

When I try in pry (which is a substitute for IRB or rails console) doc = Nokogiri::HTML(open(url)) It reads the file (although I have to keep pressing space bar). However, at the end, it says (END) and it doesn't return the command line back to…
Castielle
  • 435
  • 1
  • 5
  • 16
0
votes
0 answers

starting pry shell on linux

When i enter the pry command to start the pry shell i get this : Output here.Unable to post on SO Why doesn't the pry shell start up ? Installation commands were : rvm pkg install zlib gem install pry pry-doc rvm reinstall 1.9.3
Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
0
votes
1 answer

starting pry shell

I have downloaded the zip package for windows of pry an alternative for irb shell from github. I have unzipped the package. How do i start the pry shell ?
program-o-steve
  • 2,630
  • 15
  • 48
  • 67
-1
votes
0 answers

Pry and pry-rails weird errors

So everytime I start pry console on my windows machine, it initially works as normal for the first line, but then it somehow doubles and repeats itself in some weird way at the next lines. PS C:\Users\locdu\OneDrive\Desktop\twittery> rails console …
1 2 3
30
31