pry

Pry Remote / ByeBug next goes into Teardown

假装没事ソ 提交于 2019-12-12 03:18:49
问题 So I've decided to split my last post since the bug is Related to ByeBug more than to Pry-Remote (I think). Last post URL: Pry-Remote not triggered Rails 4 Problem: When typing Next in Pry-Remote, ByeBug acts unexpectedly and goes to "teardown". Also created an ByeBug Issue: https://github.com/deivid-rodriguez/pry-byebug/issues/78 What I am running: gem 'pry-byebug', '=1.3.3' gem 'pry-stack_explorer' gem 'pry-rails' gem 'pry-remote' pry (0.10.2) coderay (~> 1.1.0) method_source (~> 0.8.1)

Libraries missing for ruby-2.2.4

为君一笑 提交于 2019-12-11 05:34:34
问题 I am trying to recompile my ruby because pry stopped working. This is the error I'm getting. Sorry, you can't use Pry without Readline or a compatible library. I did brew update rvm get head rvm cleanup all rvm reinstall ruby-2.2.4 But I'm still getting errors during the installation and can not get pry working. Libraries missing for ruby-2.2.4: /Users/travis/.rvm/rubies/ruby-2.2.4/lib/libruby.2.2.0.dylib. Refer to your system manual for installing libraries and Error running '__rvm_patch -F

binding.pry ignored by rails 3

无人久伴 提交于 2019-12-11 03:39:33
问题 I'm trying to debug my little app failing to create a Price because of an AssociationTypeMismatch. So I dig out pry, install, watch railscast and Josh's screencast and dig into the wiki. I "cd" into the prices controller but that fails. I've put <% binding.pry %> into the new.html before the submit code but Rails says that the 'pry' method is unknown. pry is in my updated Gemfile and I restarted the server. I put binding.pry into the create method of my prices_controller.rb and Rails happily

Ruby, pry: Can I add something to the command `pry example.rb` so pry automatically goes interactive when it finishes executing the script?

混江龙づ霸主 提交于 2019-12-11 00:47:45
问题 Pry goes into interactive mode if it encounters an exception (eg if you just put an undefined variable 'x' at the end of the script). (Also if, inside the script itself you require 'pry' and put binding.pry at the point you want to go interactive at.) But I'm wondering: Is there's some kind of flag/option/argument thingy that I can add to the pry example.rb command when I enter it at the command prompt, so it will go interactive when it reaches the end of executing any example.rb script,

how to change ruby version in Pry

↘锁芯ラ 提交于 2019-12-10 16:41:34
问题 My command line ruby is 1.9.2 thanks to RVM, yet when I launch pry (which point to a 1.9.2 gem) it uses ruby 1.8.7 Do you know where is the ruby version pry uses specified ? macflashy:~ $rvm info ruby: interpreter: "ruby" version: "1.9.2p290" date: "2011-07-09" platform: "x86_64-darwin11.1.0" patchlevel: "2011-07-09 revision 32553" full_version: "ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]" homes: gem: "/Users/nrolland/.rvm/gems/ruby-1.9.2-p290" ruby: "/Users/nrolland/

How to add “pry” when developing a Ruby gem

独自空忆成欢 提交于 2019-12-10 04:28:34
问题 I have a gem called "something". I would like to add pry as a development dependency when developing the gem. However I don't know how to load it. If I have "require something" inside lib/something.rb , when I release the gem, it throws a LoadError, because pry is only a development dependency. At the same time I don't want to keep adding and removing pry when I am committing code. What is the best way to require pry only when developing the application, but not require it as a dependency for

【在 Nervos CKB 上做开发】Nervos CKB 脚本编程简介[3]:自定义代币

与世无争的帅哥 提交于 2019-12-10 03:57:18
原文作者:Xuejie 原文链接: https://xuejie.space/2019_09_06_introduction_to_ckb_script_programming_udt/ Nervos CKB 脚本编程简介[3]:自定义代币 CKB 的 Cell 模型和 VM 支持许多新的用例。然而,这并不意味着我们需要抛弃现有的一切。如今区块链中的一个常见用途是 Token 发行者发布具有特殊目的/意义的新 Token。在以太坊中,我们称之为 ERC20 Token,下面让我们看看我们如何在 CKB 中构建类似的概念。为了与 ERC20 区分,在 CKB中的 Token 我们称之为 user defined token,简称 UDT。 本文使用 CKB v0.20.0 版本来演示。具体来说,我会在每个项目中使用以下提交的版本: ckb: 472252ac5333b2b19ea3ec50d54e68b627bf6ac5 ckb-duktape: 55849c20b43a212120e0df7ad5d64b2c70ea51ac ckb-sdk-ruby: 1c2a3c3f925e47e421f9e3c07164ececf3b6b9f6 数据模型 以太坊会为每个合约账户提供单独的存储空间,CKB 与之不同,CKB 是在多个 Cell 之间传递数据。Cell 的 Lock Sript 和

Using pry-rescue to debug exceptions in Cucumber steps

喜你入骨 提交于 2019-12-09 16:43:36
问题 I've added an Around hook to my Cucumber features that I had hoped would cause pry-rescue to start pry when an exception was thrown: Around do |scenario, block| Pry::rescue do block.call end end The Around hook is definitely being called, however exceptions thrown within steps aren't rescued. E.g. this step: When(/^I perform the action$/) do raise 'hell' end ... causes the feature to fail, but doesn't drop me into pry at the console. Is it possible to use pry-rescue with Cucumber? I've raised

【在 Nervos CKB 上做开发】Nervos CKB 脚本编程简介[5]:调试 debug

穿精又带淫゛_ 提交于 2019-12-09 11:41:36
作者:Xuejie 原文链接: https://xuejie.space/2019_10_18_introduction_to_ckb_script_programming_debugging/ Nervos CKB 脚本编程简介[5]:调试 debug 事实上,CKB 脚本工作的层级要比其他智能合约低很多,因此 CKB 的调试过程就显得相当神秘。在本文中,我们将展示如何调试 CKB 脚本。你会发现,其实调试 CKB 脚本和你日常调试程序并没有太大区别。 本文建立在 ckb v0.23.0 之上。具体的,我在每个项目中使用的是如下版本的 commit: ckb: 7e2ad2d9ed6718360587f3762163229eccd2cf10 ckb-sdk-ruby: 18a89d8c69e173ad59ce3e3b3bf79b5d11c5f8f8 ckb-duktape:347bf730c08eb0aab7e56e0357945a4d6cee109a ckb-standalone-debugger: 2379e89ae285e4e639b961756c22d8e4fde4d6ab 使用 GDB 调试 C 程序 CKB 脚本调试的第一种方案,通常适用于 C、Rust 等编程语言。也许你已经习惯了写 C 的程序,而 GDB 也是你的好搭档。你想知道是不是可以用 GDB 来调试 C

How to step through a loop with pry and view the value of an iterator?

Deadly 提交于 2019-12-09 04:42:26
I inserted binding.pry into my Ruby program and am trying to view the value of an iterator at each iteration of my loop: require 'pry' def longest_palindrome s max_palindrome_len = 0 for i in (0..s.length) binding.pry for j in (i..s.length) binding.pry substr = s[i..j] if substr == substr.reverse && substr.length > max_palindrome_len max_palindrome_len = substr.length end end end return max_palindrome_len end longest_palindrome "racer" I want to view the values for i and j at each iteration in the loop. I'm sure I'm just missing something here, but I haven't been able to figure out what to do