本文介绍了rails 控制台与 wirble?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用带有 wirble gem 的 rails 控制台?我原本有 wirble 给你的代码,并把它放在我的 .irbrc

How do i use rails console with the wirble gem? I originally had the code that wirble gives you and put it in my .irbrc

此时,irb 与 wirble(颜色突出显示)配合良好,但是当我启动 rails 控制台 时,它会给出关于 wirble 和暂停的错误.

At this point, irb worked fine with wirble (color highlighting), but when i would start rails console it would give an error about wirble and halt.

我更改了 irbrc 代码,因此它不会停止,但会继续出错,这至少可以加载 rails 控制台,但没有颜色突出显示.

I changed the irbrc code so it doesnt halt but continues on error, this at least gets rails console load but theres no color highlighting.

任何想法我应该放什么?这是在我的 irbrc

Any ideas what i should put? this is in my irbrc

begin
  # load and initialize wirble
  require 'wirble'
  Wirble.init
  Wirble.colorize
rescue
  puts "Couldn't load Wirble, continuing anyway"
end

推荐答案

Put gem 'wirble', :group =>:development 在你的 Gemfile 中.

Put gem 'wirble', :group => :development in your Gemfile.

附注也看看 Hirbawesome_print.

这篇关于rails 控制台与 wirble?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-22 01:16