ruby on rails - Why "bundle install" try to install outdated version of gems? -


i have different gemsets

> rvm gemset list gemsets ruby-2.0.0-p247 (found in /users/kai/.rvm/gems/ruby-2.0.0-p247) => (default)    global    rails4  > rvm gemset use rails4 using ruby-2.0.0-p247 gemset rails4  > rails -v /users/kai/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': not find 'railties' (>= 0) among 43 total gem(s) (gem::loaderror)     /users/kai/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'     /users/kai/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'     /usr/bin/rails:22:in `<main>'     /users/kai/.rvm/gems/ruby-2.0.0-p247@rails4/bin/ruby_noexec_wrapper:14:in `eval'     /users/kai/.rvm/gems/ruby-2.0.0-p247@rails4/bin/ruby_noexec_wrapper:14:in `<main>' 

and when i'm doing:

> bundle install fetching gem metadata https://rubygems.org/......... fetching gem metadata https://rubygems.org/.. using rake (10.1.0)  installing i18n (0.6.4)  installing multi_json (1.7.9)  installing activesupport (3.2.7)  installing builder (3.0.4)  installing activemodel (3.2.7)  installing erubis (2.7.0)  installing journey (1.0.4)  installing rack (1.4.5)  installing rack-cache (1.2)  installing rack-test (0.6.2)  installing hike (1.2.3)  installing tilt (1.4.1)  installing sprockets (2.1.3)  installing actionpack (3.2.7)  installing mime-types (1.23)  installing polyglot (0.3.3)  installing treetop (1.4.14)  installing mail (2.4.4)  installing actionmailer (3.2.7)  installing arel (3.0.2)  installing tzinfo (0.3.37)  installing activerecord (3.2.7)  installing activeresource (3.2.7)  installing coffee-script-source (1.6.3)  installing execjs (1.4.0)  installing coffee-script (2.2.0)  installing rack-ssl (1.3.3)  installing json (1.8.0)  installing rdoc (3.12.2)  installing thor (0.18.1)  installing railties (3.2.7)  installing coffee-rails (3.2.2)  installing jquery-rails (3.0.4)  using bundler (1.3.5)  installing rails (3.2.7)  installing sass (3.2.10)  installing sass-rails (3.2.6)  installing sqlite3 (1.3.7)  installing uglifier (2.1.2)  bundle complete! use `bundle show [gemname]` see bundled gem installed. post-install message rdoc: depending on version of ruby, may need install ruby rdoc/ri data:  <= 1.8.6 : unsupported  = 1.8.7 : gem install rdoc-data; rdoc-data --install  = 1.9.1 : gem install rdoc-data; rdoc-data --install >= 1.9.2 : nothing do! yay! 

but have ruby 2.0! why doesn't install rails 4.0 , activesupport 4.0?

bundler installs gems basing on 2 files:

  1. gemfile.lock strict versions saved during previous installation,
  2. gemfile loose version declaration user.

when generate rails project first gemfile generated this:

gem 'rails', '~> 3.2' 

after file generated bundle install ran generates gemfile.lock in strict versions of gems recorded, on succeeding call bundle install install versions saved in gemfile.lock.

to update gems newer versions:

  1. check gemfile version restrictions - might prevent installing versions get
  2. run bundle update <gem_name> update single gem , require - minimalizing scope of changes smallest possible set of changes.
  3. run bundle update update gems latest versions allowed in gemfile

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -