2016-08-12 13 views
2

私はrailsフォルダ(私は自分のレールアプリフォルダ内にあります)に「rails c」または「rails g」と入力すると、それは言った:コマンド:rails console、生成できません。エラー:コマンド 'rails'が認識されません使用法:rails COMMAND [ARGS]

エラー:コマンド「レール」は

使用状況を認識していない:レールは、私は、Windows 10用のLinuxのサブシステムを実行している[ARGS]

Usage: spring COMMAND [ARGS]                              

Commands for spring itself:                              

    binstub   Generate spring based binstubs. Use --all to generate a binstub for all known commands. Use --remove to revert.     
    help   Print available commands.                          
    server   Explicitly start a Spring server in the foreground                    
    status   Show current status.                           
    stop   Stop all spring processes for this project.                      

Commands for your application:                             

    rails   Run a rails command. The following sub commands will use spring: console, runner, generate, destroy, test.      
    rake   Runs the rake command                           
Error: Command 'rails' not recognized                            
Usage: rails COMMAND [ARGS]                              

The most common rails commands are:                            
generate Generate new code (short-cut alias: "g")                        
console  Start the Rails console (short-cut alias: "c")                      
server  Start the Rails server (short-cut alias: "s")                      
dbconsole Start a console for the database specified in config/database.yml                 
      (short-cut alias: "db")                            
new   Create a new Rails application. "rails new my_app" creates a                   
      new application called MyApp in "./my_app"                       

In addition to those, there are:                             
destroy  Undo code generated with "generate" (short-cut alias: "d")                   
plugin new Generates skeleton for developing a Rails plugin                     
runner  Run a piece of code in the application environment (short-cut alias: "r")               

All commands can be run with -h (or --help) for more information. 

コマンド、私は私は、Windowsを参照してください知っている知っているが、それは一種のです。.. Linuxで、rbenvでRubyをthis tutorialまでインストールしました。バイナリを置き換えるために

rake rails:update:bin 

Yと答え:

+0

これを試してみます。しかし、私はまだ "新しいアプリを作る"プロジェクトを作成することができますか? – truongnm

+1

これはあなたに役立つかもしれませんhttp://stackoverflow.com/questions/21608744/rails-command-error –

答えて

6

は、アプリのフォルダからこのコマンドを試してみてください。

Windows Linuxサブシステムでレールを使用して同じ問題が発生しました。私はここでの提案が見つかりました:

Rails command Error

私はそれを試してみましたが、それはので、多分あなただけでなく、私の問題を解決しました。

+0

ありがとう!男を助けた – Liker777

関連する問題