一篇介绍console使用技巧的好文章:http://errtheblog.com/post/26
除此之外,console可以运行在各种RAILS_ENV环境:
ruby 代码
-
- ruby script/console
-
-
- ruby script/console test
为了在console中让日志直接输出控制台,而不是日志文件中,修改~/.irbrc
ruby 代码
- if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
- require 'logger'
- Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
- end
分享到:
相关推荐
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
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...
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 ...
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 : ...
18. Tips & Tricks [使用技巧和经验] Blank Variable Handling [空白变量处理] Default Variable Handling [默认变量处理] Passing variable title to header template [传递变量标题给头模板] Dates [日期] ...
18. Tips & Tricks [使用技巧和经验] Blank Variable Handling [空白变量处理] Default Variable Handling [默认变量处理] Passing variable title to header template [传递变量标题给头模板] Dates [日期] ...