हाल ही में इस सवाल का आ रहा है किसी को भी के लिए: इस सवाल का जवाब, रेल 3.2 में बदल गया है क्योंकि वे वे कैसे लागू reload!
कहाँ पिछले संस्करण में आईआरबी आदेशों Object
के तरीके के रूप में जोड़ा गया था, अब वे जुड़ जाते हैं बदल दिया है वैश्विक नामस्थान प्रदूषण से बचने के लिए IRB::ExtendCommandBundle
पर।
क्या मैं अब क्या है (1) development.rb में
silence_warnings do
begin
require 'pry'
IRB = Pry
module Pry::RailsCommands ;end
IRB::ExtendCommandBundle = Pry::RailsCommands
rescue LoadError
end
end
और (2) .pryrc में
if Kernel.const_defined?("Rails") then
require File.join(Rails.root,"config","environment")
require 'rails/console/app'
require 'rails/console/helpers'
Pry::RailsCommands.instance_methods.each do |name|
Pry::Commands.command name.to_s do
Class.new.extend(Pry::RailsCommands).send(name)
end
end
end
यहाँ रेल के लिए लिंक अनुरोध जहां परिवर्तन शुरू की गई थी खींच है - https://github.com/rails/rails/pull/3509
धन्यवाद लिया, हर कोई! –