我遵循了hirb rdoc的教程,但不幸的是,我的rails控制台根本不工作。
我已经完成了sudo gem install hirb
并将hirb添加到我的gemfile中:
gem 'hirb', '~>0.7.0'
然后我启动了
bundle install
我得到这个结果:
rails c
Loading development environment (Rails 3.2.11)
> require 'hirb'
=> false
> Hirb.enable
=> true
> Municipality.all
Municipality Load (0.8ms) SELECT "municipalities".* FROM "municipalities" ORDER BY name asc
=> [#<Municipality id: 1, district_id: 6, name: "Ambalamanasy II", created_at: "2013-01-16 12:11:45", updated_at: "2013-01-16 12:11:45">,
...
# doesn't work
有人能帮忙吗?
最佳答案
如果你使用撬作为你的轨道控制台将此添加到.pryrc文件中
require 'hirb'
Hirb.enable
old_print = Pry.config.print
Pry.config.print = proc do |output, value|
Hirb::View.view_or_page_output(value) || old_print.call(output, value)
end
关于ruby-on-rails - Hirb在Rails控制台中根本不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14473802/