Getting syntax error when running "rails new" - ruby-on-rails

When I try to create a new project by running:
rails new app
I get the following error message:
/usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require': /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/method_name_checker.rb:9: syntax error, unexpected '.' (SyntaxError)
#has_args = !exception.args&.empty?
^
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /usr/lib/ruby/vendor_ruby/did_you_mean.rb:6:in `<top (required)>'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /var/lib/gems/2.2.0/gems/thor-0.20.3/lib/thor/error.rb:4:in `<class:Thor>'
from /var/lib/gems/2.2.0/gems/thor-0.20.3/lib/thor/error.rb:1:in `<top (required)>'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /var/lib/gems/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:4:in `<top (required)>'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /var/lib/gems/2.2.0/gems/thor-0.20.3/lib/thor.rb:2:in `<top (required)>'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /var/lib/gems/2.2.0/gems/railties-5.1.4/lib/rails/command.rb:7:in `<top (required)>'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /var/lib/gems/2.2.0/gems/railties-5.1.4/lib/rails/cli.rb:10:in `<top (required)>'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /var/lib/gems/2.2.0/gems/railties-5.1.4/exe/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
I'm not sure what's going on. What's this?

The safe navigation operator &. is invalid in Ruby < 2.3. And you are using Ruby 2.2. That is the cause of the syntax error.

Try to use rvm and then install rails.
rvm install 2.5.0
Reference : https://rvm.io/rvm/install

Related

Rails get version error

I just stuck to searching my error when try to get my Rails version, anyone can help to solve this:
C:\Ruby24\bin>ruby -v ruby 2.4.1p111 (2017-03-22 revision 58053)
[i386-mingw32]
C:\Ruby24\bin>gem -v
2.6.12
C:\Ruby24\bin>rails -v
C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require':
C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/core_ext/hash/deep_merge.rb:6: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError) end
^
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/i18n.rb:1:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/inflector/inflections.rb:4:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/inflections.rb:1:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/inflector/methods.rb:1:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies/autoload.rb:1:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support.rb:25:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/command.rb:1:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/cli.rb:10:in `<top (required)>'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from C:/Ruby24/lib/ruby/gems/2.4.0/gems/railties-5.1.3/exe/rails:9:in `<top (required)>'
from C:/Ruby24/bin/rails:23:in `load'
from C:/Ruby24/bin/rails:23:in `<main>'
I ran Windows 7.
May be the gem rails not installed properly. Installing rails will solve the issue. It worked for me.
gem install rails

ruby or rails error: incompatible library version -- parser.bundle

I'm trying to run my ruby script, but I keep getting this error. I've tried reinstalling ruby and rails. ruby version is 2.3.3 and rails is 4.2.5. any ideas?
ruby firebasepushserver.rb
/Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require': incompatible library version - /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/json-2.1.0/lib/json/ext/parser.bundle (fatal)
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/json-2.1.0/lib/json/ext.rb:7:in `<module:Ext>'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/json-2.1.0/lib/json/ext.rb:6:in `<module:JSON>'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/json-2.1.0/lib/json/ext.rb:3:in `<top (required)>'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/json-2.1.0/lib/json.rb:59:in `<module:JSON>'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/json-2.1.0/lib/json.rb:55:in `<top (required)>'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/pg-0.20.0/lib/pg/text_encoder.rb:3:in `<top (required)>'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/pg-0.20.0/lib/pg.rb:63:in `<module:PG>'
from /Users/paulyang/.rvm/gems/ruby-2.3.3/gems/pg-0.20.0/lib/pg.rb:35:in `<top (required)>'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from /Users/paulyang/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from firebasepushserver.rb:4:in `<main>'

Nokogiri aborts Rails Commands

I am trying to start a rails server, but I keep receiving a lengthy and cryptic error message saying that I have an incompatible library version for nokogiri 1.6.8. I have looked at other similar solutions about libxml2, libxslt, and libiconv not been linked with nokogiri and I have tried the what people recommend to fix that, but I still receive the message:
Sams-MBP:toy-app name$ rails server
/Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `require': incompatible library version - /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri/nokogiri.bundle (fatal)
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `rescue in <top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/nokogiri-1.6.8/lib/nokogiri.rb:28:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/loofah-2.0.3/lib/loofah.rb:3:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/loofah-2.0.3/lib/loofah.rb:3:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/sanitize_helper.rb:2:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/sanitize_helper.rb:2:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:32:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:18:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_helper.rb:4:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:50:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:50:in `<module:Helpers>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/actionview-5.0.0/lib/action_view/helpers.rb:3:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:7:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:7:in `<module:Context>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:6:in `<module:Rails>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:5:in `<module:Sprockets>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/rails/context.rb:4:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/railtie.rb:7:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/sprockets-rails-3.1.1/lib/sprockets/railtie.rb:7:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:14:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:14:in `block in <top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:12:in `each'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/all.rb:12:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/config/application.rb:3:in `require'
from /Users/name/RubyWorkspace/toy-app/config/application.rb:3:in `<top (required)>'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/name/RubyWorkspace/toy-app/vendor/bundle/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Remove the Gemfile.lock in the root directory of the application. Then, remove the versions written in the Gemfile, just have the name of the gem there. Then, again do bundle install. Maybe this can help.

Cannot load nokogiri when installing rails_admin in rails 4.0.0

When trying to run rails g rails_admin:install I get the following error:
/home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack/pjax.rb:1:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack/pjax.rb:1:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack-pjax.rb:2:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rack-pjax-0.7.0/lib/rack-pjax.rb:2:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin/engine.rb:7:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin/engine.rb:7:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin.rb:1:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/rails_admin-0.5.0/lib/rails_admin.rb:1:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/vieirater/website/config/application.rb:7:in `<top (required)>'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
from /home/vieirater/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
You can try to run
rvm ruby-2.0.0-p247 gem update --system
More detail in this blog post on the very same issue.

Error with rails after update to 4.0.0.rc1

recently I have updated to rails 4.0.0.rc1 and I have been experiencing a few errors. I am currently using RVM as well. After creating a rails 4 app and running 'rails s' or 'rspec rails' i got the error -
/Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json/common.rb:67:in `initialize': no implicit conversion of nil into Hash (TypeError)
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json/common.rb:67:in `new'
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json/common.rb:67:in `generator='
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json/ext.rb:17:in `<module:Ext>'
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json/ext.rb:12:in `<module:JSON>'
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json/ext.rb:9:in `<top (required)>'
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json.rb:58:in `require'
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json.rb:58:in `<module:JSON>'
from /Users/metaHunts/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7/lib/json.rb:54:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0.rc1/lib/active_support/core_ext/object/to_json.rb:3:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0.rc1/lib/active_support/core_ext/object/to_json.rb:3:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0.rc1/lib/active_support/core_ext/object.rb:11:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/activesupport-4.0.0.rc1/lib/active_support/core_ext/object.rb:11:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/configuration.rb:3:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/configuration.rb:3:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/railtie.rb:2:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/railtie.rb:2:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/engine.rb:1:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/engine.rb:1:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/application.rb:4:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/application.rb:4:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails.rb:9:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails.rb:9:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0.rc1/lib/active_record/railtie.rb:2:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/activerecord-4.0.0.rc1/lib/active_record/railtie.rb:2:in `<top (required)>'
from /Users/metaHunts/Desktop/TeenStarter/config/application.rb:4:in `require'
from /Users/metaHunts/Desktop/TeenStarter/config/application.rb:4:in `<top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `block in <top (required)>'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap'
from /Users/metaHunts/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have tried reloading rvm, cleaing and repairing it as well yet I keep getting the same error. Could I please have some help in fixing it.
Thanks in advance :)
Had the same problem. For some reason I don't know it got fixed by running:
gem install json -v 1.7.7
Solved by removing RVM with
rvm implode
before reinstalling it with the command on rvm website (https://rvm.io/).

Resources