Fresh Rails 4 app is not recognizing `rails` commands, insists that I use `rails new`

落爺英雄遲暮 提交于 2019-12-24 05:46:19

问题


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.



来源:https://stackoverflow.com/questions/14942863/fresh-rails-4-app-is-not-recognizing-rails-commands-insists-that-i-use-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!