I just recently updated Ruby(2.3.1) and Rails(5.0.0.1). Now, when I get an error ( any type of error) on the rails console, it's followed by about 15-20 lines starting with 'from/Users....../.rvm/..etc'. Any idea why I am getting so many lines of this error output and if it's normal? How could I fix it? Everything else regarding Ruby/Rails works perfectly fine for me otherwise, so maybe it's just normal output. However, it is a bit of an annoyance.
The commonality in each path seems to be '.rvm'.
For example:
2.3.1 :031 > test
ArgumentError: wrong number of arguments (given 0, expected 2..3)
from (irb):31:in `test'
from (irb):31
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/railties-5.0.0.1/lib/rails/commands/console.rb:65:in `start'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb:9:in `start'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/AlfonsoGiron/workspace/sample_app/bin/rails:9:in `<top (required)>'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1#global/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `call'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/command_wrapper.rb:38:in `call'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application.rb:191:in `block in serve'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application.rb:161:in `fork'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application.rb:161:in `serve'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/AlfonsoGiron/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/AlfonsoGiron/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
2.3.1 :032 >
Thanks for any help.
Rails console uses IRB under the covers, so you're going to have to edit your IRB configuration file, usually located at ~/irbrc, and change the BACK_TRACE_LIMIT value:
IRB.conf[:BACK_TRACE_LIMIT]=0
During a Rails console session, you can also run:
conf.back_trace_limit = 0
There are many more configuration options for IRB (and by extension, Rails console). Check them out at ruby-doc.org.
Related
I am new to the ruby environment. I configured ruby and when I start the server I am hit with the series of errors. Can someone please give me a hand please.
2.3.1 :001 > rails s
NameError: undefined local variable or method `s' for main:Object
from (irb):1
from /Users/User/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/commands/console.rb:110:in `start'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/commands/console.rb:9:in `start'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
from /Users/User/workspace/dineconnect-backend/bin/rails:9:in `<top (required)>'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/commands/rails.rb:6:in `call'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/command_wrapper.rb:38:in `call'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:191:in `block in serve'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:161:in `fork'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:161:in `serve'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/User/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/User/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/User/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
You are trying to start rails server in interactive Ruby Shell (IRB or irb), or may be rails console.
use the command
rails s
in your terminal
You should have to look into this http://guides.rubyonrails.org/getting_started.html for the rails basics.
You are using rails console. Get out of the console by typing quit and then type rails s
Very new to Rails, so bear with me -
Currently paranoid that my ruby and gem versions aren't up to date because I'd occasionally get error messages when running rails test. Previously had rvm and rbenv both installed, but wow I've removed both and reinstalled rvm only.
When I go into a irb and call an action that doesn't work, such as: "foo".select, I get a simple error message:
NoMethodError: private method 'select' called for "foo":String
from (irb):4
from /Users/Joseph/.rvm/rubies/ruby-2.3.1/bin/irb:11:in '<main>'
However, when I type the same command "foo".select in rails console instead, I get:
NoMethodError: private method `select' called for "foo":String
from (irb):1
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/console.rb:65:in `start'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb:9:in `start'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/Joseph/workspace/sample_app/bin/rails:9:in `<top (required)>'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `call'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/command_wrapper.rb:38:in `call'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:191:in `block in serve'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:161:in `fork'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:161:in `serve'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/Joseph/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Joseph/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Is this normal? Or is there something wrong with my gems here?
There's nothing wrong with your gems. The thing is that when you run irb, it's just that. You only run the ruby interactive.
When you run rails console in order to show you the console it needs to go and set it for you with ActiveRecord, rails core, etc. So this (below) is all it does before it's set.
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/console.rb:65:in `start'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb:9:in `start'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/Joseph/workspace/sample_app/bin/rails:9:in `<top (required)>'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `block in load'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:287:in `load'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `call'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/command_wrapper.rb:38:in `call'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:191:in `block in serve'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:161:in `fork'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:161:in `serve'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /Users/Joseph/.rvm/gems/ruby-2.3.1#sample_app/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/Joseph/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Joseph/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Notice that irb is executed really fast, while rails console takes its time, depending on your initializers, configurations, etc.
I'm in the process of upgrading a 3.0.20 app to 4.x. This was done by starting with a blank rails4 directory and adding code/tests.
Things are going well thanks to lots of rspec tests.
When some of the test fail due to validation errors (which are expected), I am getting complaints from I18n, which appears to be trying to load a directory as a translation file.
I18n::UnknownFileType: can not load translations from $MYLONGPATH/beaumont4/lib, the file type is not known
from (irb):10:in `load_file'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/backend/base.rb:15:in `block in load_translations'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/backend/base.rb:15:in `each'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/backend/base.rb:15:in `load_translations'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/backend/simple.rb:57:in `init_translations'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/backend/simple.rb:40:in `available_locales'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/config.rb:43:in `available_locales'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n/config.rb:49:in `available_locales_set'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:278:in `locale_available?'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:151:in `translate'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activemodel-4.2.5/lib/active_model/naming.rb:188:in `human'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activemodel-4.2.5/lib/active_model/errors.rb:437:in `generate_message'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activemodel-4.2.5/lib/active_model/errors.rb:449:in `normalize_message'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activemodel-4.2.5/lib/active_model/errors.rb:300:in `add'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activemodel-4.2.5/lib/active_model/validations/length.rb:57:in `block in validate_each'
... 40 levels...
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /net/galaxy/home/mcr1002/nv/clientportaltest/beaumont4/bin/rails:9:in `<top (required)>'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `block in load'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/mcr/.rvm/gems/ruby-2.1.5/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /home/mcr/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/mcr/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
I determined finally that the problem was that my I18path was borked by me.
I did:
config.i18n.load_path += Dir[Rails.root.join('lib').to_s]
The I18n.loadpath does not take directories, but files.
I meant to do:
config.autoload_paths += Dir[Rails.root.join('lib').to_s]
ID10T error.
Rails error messages in terminal are too long and contain often useless information. Is there a gem/solution to shorten rails error messages?
Example:
2.2.2 :012 > puts 1.red
What I currently get:
NoMethodError: undefined method `red' for 1:Fixnum
from (irb):12
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/railties- 4.2.1/lib/rails/commands/console.rb:110:in `start'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in `start'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /Users/Ben/coding/krokoapp/bin/rails:8:in `<top (required)>'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Ben/.rvm/gems/ruby-2.2.2#global/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/commands/rails.rb:6:in `call'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/command_wrapper.rb:38:in `call'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application.rb:183:in `block in serve'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application.rb:156:in `fork'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application.rb:156:in `serve'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /Users/Ben/.rvm/gems/ruby-2.2.2#rails-devise-roles/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/Ben/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Ben/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'2.2.2 :013 >
What I want: (optionally in red)
NoMethodError: undefined method `red' for 1:Fixnum
===>Long error message saved in e. Get full messages with 'puts e'
Would this be possible?
You could try better_errors gem.
It provides also a better explanation of the errors via browser.
This is the link to the github repo
EDIT
If you are looking also to a customizable console (also the exception trace) try to see pry
I am working my way through the Ruby on Rails Tutorial. In chapter 5, I've hit another bump in the road that I can't figure out nor find a solution for.
For one, my home page has dissapeared and I don't know why. That is, for some reason the access to it is gone.
And when I run the test. I get the following response:
Exception encountered: RuntimeError: Application has been already initialized.
backtrace:
Can someone help?
Here is the backtrace (with some helpful formatting for easier viewing):
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:135:in `initialize!'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/tomgalpin/rails_projects/sample_app/config/environment.rb:5:in `<top (required)>'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
/Users/tomgalpin/rails_projects/sample_app/spec/spec_helper.rb:3:in `<top (required)>'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:11:in `block in run'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
This fixed the issue for me:
bundle exec spork --bootstrap