title: Rails: "bundle install" failed because of old rails version(3.2)
body: <p>I recently got a old Rails application and trying to install gems through <code>bundle install</code>. But it keeps reminding me :</p>
  
  <blockquote>
    <p>Bundler could not find compatible versions for gem "bundler": In Gemfile:rails (~> 3.2) was resolved to 3.2.22.5, which depends on bundler (~> 1.0)</p>
  </blockquote>
  
  <p>After some google search, I get to know that rails 3.2 freezes bundler version at 1.0. So I uninstalled my current bundler(2.0.1) by doing `gem uninstall bundler -v 2.0.1<code>and install bundler 1.0.10</code>gem install bundler -v 1.0.10```, but another error occurs:</p>
  
  <blockquote>
    <p>/home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3:in <code>&lt;top (required)&gt;': 
    undefined method</code>source_index' for Gem:Module (NoMethodError)
    Did you mean?  sources
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in <code>require'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in</code>require'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:195:in <code>default_gemfile'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:165:in</code>root'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:171:in <code>app_config_path'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler.rb:183:in</code>settings'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/cli.rb:222:in <code>install'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in</code>run'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in <code>invoke_task'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in</code>dispatch'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in <code>start'
        from /home/alec/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/bundler-1.0.10/bin/bundle:13:in</code>'
        from /home/alec/.rbenv/versions/2.3.7/bin/bundle:22:in <code>load'
        from /home/alec/.rbenv/versions/2.3.7/bin/bundle:22:in</code>'</p>
  </blockquote>
  
  <p>BTW, my Gemfile:</p>
  
  <pre><code>source 'http://gems.ruby-china.com'
  
  unless RUBY_PLATFORM =~ /w32/
    # unix-like only
    gem 'iconv'
    if RUBY_PLATFORM =~ /darwin/
      gem "rmagick", "= 2.15.4" ## osx must be this version
    elsif RUBY_PLATFORM =~ /linux/
      gem 'simple_xlsx_reader'
      gem "rmagick", "~&gt; 2.13.1" ## centos yum install ImageMagick-devel
      gem 'pdfkit'
      gem 'wkhtmltopdf-binary'
      gem 'rqrcode', '~&gt; 0.10.1'
      gem 'rqrcode_png'
    end
    gem 'certified'
    gem 'net-ssh', '2.9.1'
    gem 'jenkins_api_client'
    gem 'nokogiri'
  end
  
  #gem 'simple_xlsx_reader'
  gem 'wechat',path: 'lib/wechat'
  gem 'grack', path:'lib/grack'
  gem 'gitlab', path: 'lib/gitlab-cli'
  gem 'rest-client'
  gem "mysql2", "= 0.3.18"
  gem 'redis-rails'
  gem 'rubyzip'
  gem 'delayed_job_active_record'#, :group =&gt; :production
  gem 'daemons'
  gem 'grape', '~&gt; 0.9.0'
  gem 'grape-entity', '= 0.4.5'
  gem 'rack-cors', :require =&gt; 'rack/cors'
  gem 'seems_rateable', '~&gt; 1.0.13'
  gem 'rails', '~&gt; 3.2'
  gem "jquery-rails", "~&gt; 2.0.2"
  gem "i18n", "~&gt; 0.6.0"
  gem 'coderay', '~&gt; 1.1.0'
  gem "fastercsv", "~&gt; 1.5.0", :platforms =&gt; [:mri_18, :mingw_18, :jruby]
  gem "builder", "3.0.0"
  gem 'acts-as-taggable-on', '2.4.1'
  gem 'spreadsheet'
  gem 'ruby-ole'
  gem 'rails_kindeditor',path:'lib/rails_kindeditor'
  gem 'binding_of_caller'
  gem 'chinese_pinyin'
  # gem 'sunspot_rails', '~&gt; 1.3.3'
  # gem 'sunspot_solr'
  # gem 'sunspot'
  # gem 'progress_bar'
  gem  'ansi'
  
  gem 'kaminari'
  gem 'elasticsearch-model'
  gem 'elasticsearch-rails'
  
  #rails 3.2.22.2 bug
  # gem "test-unit", "~&gt;3.0"
  
  ### profile
  # gem 'oneapm_rpm'
  # gem 'therubyracer'
  
  group :development do
    gem 'grape-swagger'
    gem 'better_errors', '~&gt; 1.1.0'
    # gem "query_reviewer"
    gem 'rack-mini-profiler', '~&gt; 0.9.3'
    if RUBY_PLATFORM =~ /w32/
      gem  'win32console'
    end
  
    if RUBY_PLATFORM =~ /darwin/
      gem 'puma'
  end
  end
  
  group :development, :test do
      if RUBY_VERSION &gt;= '2.0.0'
        gem 'pry-byebug'
      gem "test-unit", "~&gt;3.0"
      end
    gem 'rspec-rails', '~&gt; 3.0'
    gem 'factory_girl_rails'
  end
  
  # Gems used only for assets and not required
  # in production environments by default.
  group :assets do
    gem 'sass-rails',   '~&gt; 3.2.3'
    gem 'coffee-rails', '~&gt; 3.2.1'
  
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer', :platforms =&gt; :ruby
  
    gem 'uglifier', '&gt;= 1.0.3'
  end
  
  # Optional gem for LDAP authentication
  group :ldap do
    gem "net-ldap", "~&gt; 0.3.1"
  end
  
  
  # Optional gem for OpenID authentication
  group :openid do
    gem "ruby-openid", "~&gt; 2.1.4", :require =&gt; "openid"
    gem "rack-openid"
  end
  
  
  database_file = File.join(File.dirname(__FILE__), "config/database.yml")
  if File.exist?(database_file)
  else
    warn("Please configure your config/database.yml first")
  end
  
  # Load plugins' Gemfiles
  Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
    puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
    instance_eval File.read(file)
  end
  </code></pre>
  
  <p>I have searched everywhere but nothing useful. Any help would highly appreciated!Thx.</p>