0

So I I am trying to start the rails server and I get the error below:

Hey guys, I tried to start the server with rails s and I get this error:

ldco2016@DCortes-MacBook-Pro-3 ~/Projects/blog_app (master)$ rails s                                                                                                                                                                                                     [ruby-2.2.0]
/Users/ldco2016/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'railties' (>= 0.a) among 14 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/ldco2016/.rvm/gems/ruby-2.2.0:/Users/ldco2016/.rvm/gems/ruby-2.2.0@global', execute `gem env` for more information
from /Users/ldco2016/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /Users/ldco2016/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /usr/local/bin/rails:22:in `<main>'

I attempted changing ruby versions but I am not sure what is going on here.

So I have done both a bundle exec and a bundle exec rails s and I have reinstalled ruby-2.2.5 but still not resolved.

Daniel
  • 14,004
  • 16
  • 96
  • 156
  • 1
    Have you tried `bundle install`? Also edit title and Q itself before it is downvoted and closed :-) – mlt Dec 22 '16 at 22:13
  • You may also need to run it as `bundle exec rails s` (your stacktrace looks like it's trying to hit the global rails binary, which isn't something I'd ever want). – Robert Nubel Dec 22 '16 at 22:17
  • @mlt, edit title to what exactly, I will be happy to do it. Do not want to violate any rules here. – Daniel Dec 23 '16 at 02:22
  • Possible duplicate of [Rails: Could not find railties](http://stackoverflow.com/questions/9212116/rails-could-not-find-railties) – mlt Dec 28 '16 at 22:24

1 Answers1

0

It seems your Rails installation is corrupted or maybe there's no Rails installed. Run this command and see if there any version of Rails installed:

$ gem list

If there is no Rails, you can easily install it by running:

$ gem install rails
Gabriel Lidenor
  • 2,905
  • 2
  • 25
  • 26
  • your answer was the correct one. I would like to understand how you were able to deduce this from the error message. Thank you. – Daniel Dec 23 '16 at 02:29
  • This line "Could not find 'railties'." Railties is responsible to put all the frameworks together. If there's no railties then there's no way to put all the frameworks together, like: ActiveRecord, ApplicationController and so on. Check the repository for more info: https://github.com/rails/rails/tree/master/railties – Gabriel Lidenor Dec 23 '16 at 10:31