1

My application server is not starting and giving the error when I am trying to start the server by:

bundle exec rails server -b 0.0.0.0

Traceback (most recent call last):
    4: from /root/workspace/abl-rest-client_ruby/local/ruby/2.6.0/bin/ruby_executable_hooks:24:in `<main>'
    3: from /root/workspace/abl-rest-client_ruby/local/ruby/2.6.0/bin/ruby_executable_hooks:24:in `eval'
    2: from /usr/local/rvm/gems/ruby-2.6.3/bin/rails:23:in `<main>'
    1: from /usr/local/rvm/gems/ruby-2.6.3/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path'
    /usr/local/rvm/gems/ruby-2.6.3/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in 
   `block in replace_bin_path': can't find executable rails for gem railties. railties is not     
    currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)

I just started working on rails yesterday, so I am too new to the entire concept. I understand the error that I am missing the railties gem but I am unable to add it. I have tried uninstalling gems, removing gems, re-installing those, etc. as per the answers to this question 'https://stackoverflow.com/questions/9212116/rails-could-not-find-railties' but nothing helped.

My gem list has the railties version 6.1.0 but my vendor/cache doesn't have it. I am using windows for the development and I am inside a docker container.

I don't know if not having the railties in my vendor/cache is the problem or I am missing something else.

I have already tried a couple of solutions like specifying my ruby version to rvm

rvm use -myrubyversion, re-starting bundler a couple of times, etc.

Any suggestions?

shelholmes221
  • 518
  • 1
  • 7
  • 18
  • Assuming you created the application using `rails new ApplicationNameHere` you should not have this issue as railties is bundled with rails and rails will generate the Gemfile for you. Can you please provide a bit more context as to how you went about creating your application? – engineersmnky Dec 30 '20 at 18:46
  • It's an existing application that I simply want to run on my machine. So, I don't have a lot idea about the creation. – shelholmes221 Dec 31 '20 at 14:49
  • Go to the root of the application and try and run `bundle install` this should load all the requisite libraries. Then retry running `rails s` – engineersmnky Dec 31 '20 at 17:20

1 Answers1

0

Make sure your terminal is in the root of the application and not the folder above it. That is, after you run rails new application_name_here enter cd application_name_here to get to the right folder.