问题描述
我已经使用 rails new
命令从 Rails 主分支的克隆成功创建了一个新应用程序.该应用程序看起来不错,绝对是 Rails 4.但是当我尝试运行任何其他 rails
命令时,提示给了我:
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
我试过 rails
、bundle exec rails
和 bin/rails
,都给出相同的提示.我创建一个新的 Rails 4 应用的步骤是:
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:
- 将 Rails 主分支克隆到我的本地机器
- 创建一个新的 rvm gemset,并使用它 (1.9.3)
- 运行
rails/railties/bin/rails new myapp --edge -T --skip-index-html
cd myapp
并运行bundle install
和bundle update
以确保- 运行任何
rails
命令
- Clone the Rails master branch to my local machine
- Create a new rvm gemset, and use it (1.9.3)
- Run
rails/railties/bin/rails new myapp --edge -T --skip-index-html
cd myapp
and runbundle install
andbundle update
just to be sure- Run any
rails
command
我做错了什么?rvm-prompt
表明我使用了正确的 gemset.我注意到的一件事是,即使我从 Gemfile 中删除 jbuilder 并运行 bundle update
,它仍然出现在我的 gem list
中.我的 rvm 有问题吗?
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
输出是Rails 4.0.0.beta"
rails-v
output is 'Rails 4.0.0.beta'
推荐答案
这看起来像一个 bug,反馈给 ruby on rails 问题跟踪:https://github.com/rails/rails/issues
This looks like a bug, report back to ruby on rails issues tracking: https://github.com/rails/rails/issues
这篇关于Fresh Rails 4 应用程序无法识别“rails"命令,坚持使用“rails new"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!