1

getting error on rails new myapp

/home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'railties' (>= 0) among 19 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/high-tech/.rvm/gems/ruby-2.2.3:/home/high-tech/.rvm/gems/ruby-2.2.3@global', execute `gem env` for more information
    from /home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
    from /home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
    from /home/high-tech/.rbenv/versions/2.2.0/bin/rails:22:in `<main>'
Dave Newton
  • 158,873
  • 26
  • 254
  • 302
Pooja Mokariya
  • 1,970
  • 5
  • 21
  • 46
  • 2
    So you need railties' (>= 0) Try the solution in this thread - http://stackoverflow.com/questions/9212116/rails-could-not-find-railties – PolarisUser Oct 26 '15 at 21:04
  • This both errors solved with the help of this : http://stackoverflow.com/questions/32492424/error-installing-rails-error-failed-to-builed-gem-native-extension – Pooja Mokariya Oct 26 '15 at 22:00

1 Answers1

2

Rails' dependencies might not be correctly installed.

Try the following:

bundle show railties

If it fails:

gem install railties

to install the gem. Hope it helps.

F. Fiebig
  • 126
  • 5
  • it is done for rails new but give me error on bundle install. /projects/myapp$ bundle install /home/high-tech/.rbenv/versions/2.2.0/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 19 total gem(s) (Gem::LoadError) – Pooja Mokariya Oct 26 '15 at 21:38
  • 1
    In the thread that PolarisUser mentioned, Arkaaito said that, for him, it was because he installed rails using sudo, give a try to `gem install rails` if you did too. – F. Fiebig Oct 26 '15 at 21:40
  • gem install rails is failed. – Pooja Mokariya Oct 26 '15 at 21:45
  • 1
    Error installing rails: ERROR: Failed to build gem native extension. /home/high-tech/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20151027-25878-xhfsdy.rb extconf.rb checking if the C compiler accepts ... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. – Pooja Mokariya Oct 26 '15 at 21:49