rails: Missing json in default Gemfile

Hi all,

When I try to create a new project with last stable release and to execute

bundle exec rake db:create

I have

/home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext/object/json.rb:2:in `require': cannot load such file -- json (LoadError)
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext/object/json.rb:2:in `<top (required)>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext/object.rb:11:in `require'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/core_ext/object.rb:11:in `<top (required)>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/configuration.rb:2:in `require'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/configuration.rb:2:in `<top (required)>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/railtie/configuration.rb:1:in `require'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/railtie/configuration.rb:1:in `<top (required)>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/railtie.rb:216:in `require'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/railtie.rb:216:in `config'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails/railtie.rb:122:in `config'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/i18n_railtie.rb:7:in `<class:Railtie>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/i18n_railtie.rb:6:in `<module:I18n>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/i18n_railtie.rb:5:in `<top (required)>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/railtie.rb:2:in `require'
    from /home/waghanza/.gem/ruby/2.3.0/gems/activesupport-5.0.0/lib/active_support/railtie.rb:2:in `<top (required)>'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails.rb:14:in `require'
    from /home/waghanza/.gem/ruby/2.3.0/gems/railties-5.0.0/lib/rails.rb:14:in `<top (required)>'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
    from /usr/local/share/gems/gems/bundler-1.12.5/lib/bundler/inline.rb:60:in `gemfile'
    from /tmp/test.rb:8:in `<main>'

This error could be reproducible with

begin
  require 'bundler/inline'
rescue LoadError => e
  $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
  raise e
end

gemfile(true) do
  source 'https://rubygems.org'
  gem "rails", ">= 5.0.0.rc2", "< 5.1"
end

I’m using ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux].

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Thanks @waghanza ! I have not added the “gem ‘json’” in my GemFile.

Now it’s ok!