LoginSignup
30
12

More than 5 years have passed since last update.

rails newで現在のディレクトリにプロジェクトを作る

Last updated at Posted at 2016-04-25

あまりに当たり前すぎてあくびも出ないくらい初歩的なことですが、ここで詰んでたのでメモ。

rails tutorial なんかを読んでると、新規プロジェクトを作るときに

$ rails new project_name

といった感じでプロジェクト名を指定しますね。
しかしこれだと現在のディレクトリから更に掘り下げてプロジェクトが作られてしまいます。

$rails new project_name

now_directory
  └project_name
    ├app
    │ ├assets
    │ ├controllers
    │ ├helpers
    │ ├ ……
    ├bin
    ├config
    ├db
    ├ ……

そうではなく、現在のディレクトリにそのままrailsのファイルを作りたい場合はproject_nameのところを.(ドット)にするだけ。

$ rails new .

now_directory
  ├app
  │ ├assets
  │ ├controllers
  │ ├helpers
  │ ├ ……
  ├bin
  ├config
  ├db
  ├ ……

以上、超初歩的なrails newのメモでした。

30
12
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
12