Rails console not starting. Error in .irbrc file?

rails
ruby

#1

I can’t open rails console, and i get this error. Any ideas ? It appears to be this ~/.irbrc file that is preventing me from loading the console. I have included my Gemfile at the bottom.

dball1126:~/workspace/sample_apps (master) $ rails console
Running via Spring preloader in process 30213
Loading development environment (Rails 5.0.1)
/usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in load': /home/ubuntu/.irbrc:1: unterminated regexp meets end of file (SyntaxError) from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:inblock in load’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:inload’
from /usr/local/rvm/scripts/irbrc.rb:70:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:inrequire’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in block in require' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:inload_dependency’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in require' from /usr/local/rvm/rubies/ruby-2.3.0/.irbrc:11:in<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in load' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:inblock in load’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:inload’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/init.rb:231:in run_config' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/init.rb:20:insetup’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb.rb:378:in start' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/commands/console.rb:65:instart’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/commands/console_helper.rb:9:in start' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:78:inconsole’
from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in run_command!' from /usr/local/rvm/gems/ruby-2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in require' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:inblock in require’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in load_dependency' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:inrequire’
from /home/ubuntu/workspace/sample_apps/bin/rails:9:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:inload’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in block in load' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:inload_dependency’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:287:in load' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in

Here is my Gem file:

source ‘https://rubygems.org

gem ‘rails’, '5.0.1’
gem ‘bcrypt’, '3.1.11’
gem ‘faker’, '1.6.6’
gem ‘carrierwave’, '0.11.2’
gem ‘mini_magick’, '4.5.1’
gem ‘fog’, '1.38.0’
gem ‘will_paginate’, '3.1.0’
gem ‘bootstrap-will_paginate’, '0.0.10’
gem ‘bootstrap-sass’, '3.3.6’
gem ‘puma’, '3.4.0’
gem ‘sass-rails’, '5.0.6’
gem ‘uglifier’, '3.0.0’
gem ‘coffee-rails’, '4.2.1’
gem ‘jquery-rails’, '4.1.1’
gem ‘turbolinks’, '5.0.1’
gem ‘jbuilder’, '2.4.1’
gem 'minitest’
gem ‘test-unit’

group :development, :test do
gem ‘sqlite3’, '1.3.12’
gem ‘byebug’, ‘9.0.0’, platform: :mri
end

group :development do
gem ‘web-console’, '3.1.1’
gem ‘listen’, '3.0.8’
gem ‘spring’, '1.7.2’
gem ‘spring-watcher-listen’, '2.0.0’
end

group :test do
gem ‘rails-controller-testing’, '0.1.1’
gem ‘minitest-reporters’, '1.1.9’
gem ‘guard’, '2.13.0’
gem ‘guard-minitest’, '2.4.4’
end

group :production do
gem ‘pg’, '0.18.4’
end

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem ‘tzinfo-data’, platforms: [:mingw, :mswin, :x64_mingw, :jruby]


#2

did you create the .irbc file? check if it indeed has an error, and try removing that file.


#3

Thanks, that pretty much solved my problem. I created the .irbrc file by accident while following a tutorial. Once i removed the contents in that file the error went away and I was able to start the console. I would of deleted the file, but still trying to find the command for that, either way the issue is now solved…


#4

You can delete it with rm /home/ubuntu/.irbrc (note that rm is not reversible)