Sunday, November 15, 2015

Could not find 'railties' (>= 0) among 46 total gem(s) (Gem::LoadError) in Rails 5 Project

Problem

zepho-mac-pro:rails5 zepho$ rails -v
/Users/zepho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'railties' (>= 0) among 46 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/zepho/.rvm/gems/ruby-2.2.3@r5blog:/Users/zepho/.rvm/gems/ruby-2.2.3@global', execute `gem env` for more information
from /Users/zepho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /Users/zepho/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /Users/zepho/.rvm/gems/ruby-2.2.3@r5blog/bin/rails:22:in `
'


Fix:

zepho-mac-pro:rails5 zepho$ bundle check
Resolving dependencies...
The Gemfile's dependencies are satisfied
zepho-mac-pro:rails5 zepho$ gem list rails

*** LOCAL GEMS ***

jquery-rails (4.0.5)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.2)
sprockets-rails (2.3.3)
zepho-mac-pro:rails5 zepho$ gem list railties

*** LOCAL GEMS ***


zepho-mac-pro:rails5 zepho$ gem install rails
Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: activesupport-4.2.5.gem (100%)
Successfully installed activesupport-4.2.5
Fetching: actionview-4.2.5.gem (100%)
Successfully installed actionview-4.2.5
Fetching: actionpack-4.2.5.gem (100%)
Successfully installed actionpack-4.2.5
Fetching: railties-4.2.5.gem (100%)
Successfully installed railties-4.2.5
Fetching: activejob-4.2.5.gem (100%)
Successfully installed activejob-4.2.5
Fetching: actionmailer-4.2.5.gem (100%)
Successfully installed actionmailer-4.2.5
Fetching: arel-6.0.3.gem (100%)
Successfully installed arel-6.0.3
Fetching: activemodel-4.2.5.gem (100%)
Successfully installed activemodel-4.2.5
Fetching: activerecord-4.2.5.gem (100%)
Successfully installed activerecord-4.2.5
Fetching: rails-4.2.5.gem (100%)
Successfully installed rails-4.2.5
11 gems installed
zepho-mac-pro:rails5 zepho$ rails -v
Rails 5.0.0.alpha