2015-11-26 49 views
0

當嘗試使用byebug首次使用Ruby 2.2.3,我得到byebug和Ruby 2.2.3

NameError: 
     undefined local variable or method `byebug' 

我很困惑,這裏的一些診斷:

ruby --version 
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14] 

cat Gemfile | grep bye 
gem 'byebug' 

gem list | grep bye 
byebug (8.2.1, 8.2.0) 

#the command I'm using to run my ruby code is 
rspec *spec.rb --tag focus 
#also tried prepending bundle exec 
+0

爲了便於調試,我在rspec_helper中有一個require'byebug'。 – Axe

回答

0

圖出來。我需要這條線:

require 'byebug'; byebug; 

在我的紅寶石代碼。

0

你在應用程序上運行了bundle install(假設這是在一個Rails應用程序的上下文中,因爲你使用的是Gemfiles)?

編輯:你弄明白了,我看到:D我打算建議下一步需要圖書館,但我發現我並不需要。