如何让IRBRC在Win32 for Ruby控制台上运行? [英] How do I get IRBRC running on Win32 for Ruby console?

查看:251
本文介绍了如何让IRBRC在Win32 for Ruby控制台上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以建议一些故障排除方法让IRBRC在Win32下运行? rails控制台是一个真棒工具,我试图扩展它更多的功能。

Can anyone suggest some troubleshooting approaches for getting IRBRC running under Win32? The rails console is an awesome tool and I'm attempting to extend it with more functionality.

例如,我想要what_method gem自动加载。已安装gem但不加载:

For instance, I would like the what_method gem to load automatically. The gem is installed but it does not load:

C:\...\trunk>ruby script\console
Loading development environment (Rails 2.3.2)
>> 3.45.what? 3
NoMethodError: undefined method `what?' for 3.45:Float
        from (irb):1
>> require 'what_methods'
=> ["DummyOut", "WhatMethods"]
>> 3.34.what? 3
3.34.round_with_precision == 3
...
=> ["round_with_precision", "round", "prec_i", ... "round_without_precision"]
>>



我的环境设置为



My environment is setup as

C:\...\trunk>dir %HOME%
 Volume in drive C is OS
...
06/21/2009  10:29 AM    <DIR>          .
06/21/2009  09:28 AM               118 .irbrc
...

环境变量路径IRBRC =%HOME%\.irbrc

Environment variable path IRBRC = %HOME%\.irbrc

require 'irb/completion'
require 'map_by_method'
require 'what_methods'
require 'pp'
IRB.conf[:AUTO_INDENT]=true



我已阅读以下参考资料



http://railscasts.com/episodes/48-console-tricks

http ://drnicwilliams.com/2006/10/12/my-irbrc-for-consoleirb/#irbrc_win32

http://groups.google.com/group/ruby-talk-google/browse_thread/thread/ 23fe3980a5a4816e

http://www.nabble.com/.irbrc-on-Windows-td23954309.html

推荐答案

使用Pry: http://pry.github.com

允许您:


  • 查看方法源代码

  • 查看方法文档

  • 语法高亮显示


  • 查看和重放历史记录

  • 打开编辑器使用编辑方法编辑方法obj.my_method 语法

  • view method source code
  • view method documentation (not using RI so you dont have to pre-generate it)
  • pop in and out of different contexts
  • syntax highlighting
  • gist integration
  • view and replay history
  • open editors to edit method using edit-method obj.my_method syntax

一吨多的原创功能

查看上面的链接的屏幕录像,它也适用于Rails。 :)

View the screencast on that link above, it also works with Rails. :)

这篇关于如何让IRBRC在Win32 for Ruby控制台上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆