Fresh Rails 4 app is not recognizing `rails` comma

2019-07-21 07:26发布

问题:

I've successfully made a new application with the rails new command from a clone of the Rails master branch. The app looks fine, and is definitely Rails 4. But when I try to run any other rails command, the prompt gives me:

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
  ... etc etc

I've tried rails, bundle exec rails, and bin/rails, all give the same prompt. My steps for creating a new Rails 4 app were:

  1. Clone the Rails master branch to my local machine
  2. Create a new rvm gemset, and use it (1.9.3)
  3. Run rails/railties/bin/rails new myapp --edge -T --skip-index-html
  4. cd myapp and run bundle install and bundle update just to be sure
  5. Run any rails command

What am I doing wrong? rvm-prompt suggests I am using the right gemset. One thing I did notice is that even when I remove jbuilder from my Gemfile and run a bundle update, it still appears in my gem list. Is something wrong with my rvm here?

rails-v output is 'Rails 4.0.0.beta'

回答1:

This looks like a bug, report back to ruby on rails issues tracking: https://github.com/rails/rails/issues



回答2:

See my first comment here, it contains a possible fix : https://github.com/rails/rails/issues/9715



回答3:

I had this issue when my 'bin' folder was missing.