rails-console

set rails console stack backtrace limit permanently

痞子三分冷 提交于 2019-11-29 11:17:11
rails console by default boots with context.back_trace_limit=16 , which can be changed to whatever you want simply by typing context.back_trace_limit=n . The problem is you have to type it each time you boot rails c . Where do I change the context.back_trace_limit permanently? Some more reading on rails console configuration appreciated. Fer You have to create/edit your ~/.irbrc with the following: IRB.conf[:BACK_TRACE_LIMIT]= 20 To be taken into account: The options must be uppercased This option is changing not only the rails console, but the normal "irb" behavior (the rails console uses irb

Rails console not working on server

只愿长相守 提交于 2019-11-29 05:17:02
问题 When I run bundle exec rails console production or rails console production via SSH on the server in the Current folder of the Capistrano deploy I get: Usage: rails new APP_PATH [options] Options: (...) with an explanation to start a new app. Locally it works. Why can't I start a console remotely? 回答1: I'm assuming that you updated to rails 4 from version 3 and your app can't find the executables in the bin directory. Run this to see your rails version: $ rails -v If your rails version is 4

Rails console 'y' helper returns NameError rather than yaml-formatting output

梦想的初衷 提交于 2019-11-28 20:42:19
I'm trying to use y object in Rails 3.2.6/Ruby 1.9.3 console to get nicely formatted yaml output for an ActiveRecord object, but for some reason it isn't working for me. I've used it in the past, but somewhere along the way it broke. I get the following output when I try: NameError: undefined local variable or method `yaml' for main:Object The y method is actually an extension to the Kernel object put in place by the Syck YAML parser/emitter . Here are the last few lines of lib/ruby/1.9.1/syck.rb : module Kernel def y( object, *objects ) objects.unshift object puts( if objects.length == 1 YAML

Rails Console: reload! not reflecting changes in model files? What could be possible reason?

人走茶凉 提交于 2019-11-27 03:36:53
Earlier it was working fine. I have been playing little bit config. So may be i have changed some config unknowingly. here is config of environment/development.rb config.cache_classes = false # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_view.debug_rjs = true config.action_controller.perform_caching = false # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger config