title: Ruby on rails bundle install - json error
body: <p>I have a lot of difficulties to run Ruby on Rails. Maybe you can tell me where I'm wrong ?
  I'm on Linux Mint 17.2, with LAMP local server.</p>
  
  <p>To install Ruby :</p>
  
  <pre><code>$ sudo apt-get install ruby
  $ ruby -v
  ruby 1.9.3p484
  $
  </code></pre>
  
  <p>I didn't have to install gem, it works as shown here :</p>
  
  <pre><code>$ gem help commands
  
      GEM commands are:
  
          build             Build a gem from a gemspec
          cert              Manage RubyGems certificates and signing settings
      (...)
          update            Update the named gems (or all installed gems) in the local
                            repository
          which             Find the location of a library file you can require
  
      For help on a particular command, use 'gem help COMMAND'.
  
      Commands may be abbreviated, so long as they are unambiguous.
      e.g. 'gem i rake' is short for 'gem install rake'.
  
  Then I installed rails, I dont remember which of those two ways :
  
      $ sudo gem install rails
  
  or
  
      $ sudo apt-get install ruby-railties-4.0
  
  I dont find how to uninstall, so I can't test other ways to install.
  
  Then, I made an application :
  
          $ rails new (path)/second_app
  
            create  
            create  README.rdoc
            create  Rakefile
            create  config.ru
            create  .gitignore
            create  Gemfile
            create  app
            create  app/assets/javascripts/application.js
            (...)
            create  vendor/assets/javascripts
            create  vendor/assets/javascripts/.keep
            create  vendor/assets/stylesheets
            create  vendor/assets/stylesheets/.keep
               run  bundle install
      /usr/lib/ruby/1.9.1/rubygems.rb:308:in `bin_path': can't find gem bundler (&gt;= 0) (Gem::GemNotFoundException)
          from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/generators/app_base.rb:268:in `bundle_command'
          from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/generators/app_base.rb:277:in `run_bundle'
          from (eval):1:in `run_bundle'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
          from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
          from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/application.rb:43:in `&lt;top (required)&gt;'
          from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/cli.rb:15:in `&lt;top (required)&gt;'
          from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
          from /var/lib/gems/1.9.1/gems/railties-4.0.2/bin/rails:9:in `&lt;top (required)&gt;'
          from /usr/local/bin/rails:23:in `load'
          from /usr/local/bin/rails:23:in `&lt;main&gt;'
  </code></pre>
  
  <p>It looks like it was a problem running bundle install. According to tutorials, I run the command </p>
  
  <pre><code>$ bundle install
  </code></pre>
  
  <p>And I got</p>
  
  <pre><code>Fetching gem metadata from https://rubygems.org/............
  Fetching gem metadata from https://rubygems.org/..
  Resolving dependencies...
  Using rake (10.4.2) 
  Using i18n (0.7.0) 
  Using minitest (4.7.5) 
  …
  Using jbuilder (1.5.3) 
  Using jquery-rails (3.1.3) 
  Installing json (1.8.3) 
  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  
          /usr/bin/ruby1.9.1 extconf.rb 
  /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
      from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      from extconf.rb:1:in `&lt;main&gt;'
  
  
  Gem files will remain installed in /home/alejandro/.bundler/tmp/9377/gems/json-1.8.3 for inspection.
  Results logged to /home/alejandro/.bundler/tmp/9377/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
  An error occurred while installing json (1.8.3), and Bundler cannot continue.
  Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
  </code></pre>
  
  <p>I tryed to install json in several ways :</p>
  
  <pre><code>$ sudo gem install json -v '1.8.3'
  $ sudo apt-get install json -v '1.8.3'
  $ sudo gem install json 
  </code></pre>
  
  <p>But it don't work. I tryed to to run de server :</p>
  
  <pre><code>$ rails server
  Could not find gem 'rails (= 4.0.2) ruby' in the gems available on this machine.
  Run `bundle install` to install missing gems.
  </code></pre>
  
  <p>I have tryed to install rvm and rbenv, but nothing works in the way tutorials says it should. My feeling is that I missed something in the begynning, but I dont know what.</p>
  
  <p>Could you please help me ?</p>
  
  <p>Thanks</p>
  
  <p>Alex</p>