`
sean
  • 浏览: 16598 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

console tips and tricks

阅读更多
一篇介绍console使用技巧的好文章:http://errtheblog.com/post/26

除此之外,console可以运行在各种RAILS_ENV环境:
ruby 代码
 
  1. #默认运行在开发环境  
  2. ruby script/console  
  3.   
  4. #运行在测试环境  
  5. ruby script/console test  

为了在console中让日志直接输出控制台,而不是日志文件中,修改~/.irbrc
ruby 代码
 
  1. if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')  
  2.     require 'logger'  
  3.     Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))  
  4. end  
分享到:
评论

相关推荐

    Windows.Group.Policy.Troubleshooting

    Find out how to isolate, understand, and solve problems encountered when managing users and PCs on Windows. Learn from a Microsoft MVP with many years' ...Chapter 7: Group Policy Tips and Tricks

    Professional.MFC.with.VC6

    Tool Tips Summary Chapter 5: Using Dialogs and Controls in MFC User Interfaces: The Windows Way Drawing Your Dialog Requesters Notifications Modifiers Developing a Dialog Instantiating Your...

    SAP PO/PI教程 Process Orchestration The Comprehensive Guide

    3.5 Tips and Tricks 3.5.1 Naming Convention 3.5.2 Keeping Your System Landscape Directory Catalogs Up to Date 3.5.3 Self-Registration of a Java-Based System with the SLD 3.5.4 Configuring Data ...

    JavaScript-Goodies:收集JavaScript的好东西,从地图到传播算子| :hammer_and_wrench:关于工作

    console . log ( list ) ; // 1st [ 1, 9, 7, 8, 4, 2, 3, 5, 6 ] // 2nd [ 7, 8, 4, 3, 6, 9, 5, 2, 1 ] :magnifying_glass_tilted_right: const posts = { "mountain-view" : { name : "Everest" , height : ...

    Smarty中文手册 chm版

    18. Tips & Tricks [使用技巧和经验] Blank Variable Handling [空白变量处理] Default Variable Handling [默认变量处理] Passing variable title to header template [传递变量标题给头模板] Dates [日期] ...

    smarty手册.chm

    18. Tips & Tricks [使用技巧和经验] Blank Variable Handling [空白变量处理] Default Variable Handling [默认变量处理] Passing variable title to header template [传递变量标题给头模板] Dates [日期] ...

Global site tag (gtag.js) - Google Analytics