0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails new でディレクトリが作成されない!

0
Posted at

開発環境

xcode
homebrew
Ruby2.6.5
rails 6.0.0
VScode バージョン: 1.54.2
データベースは Sequel Pro 1.1.2

起こったこと

よし!新しいアプリを作成しようとターミナルにて

rails _6.0.0_ new (アプリ名) -d mysql

を実行したら、、、

 create  
      create  README.md
      create  Rakefile
      create  .ruby-version
      create  config.ru
      create  .gitignore
      create  Gemfile
         run  git init from "."

で終了、、、

あれ??こんな早くrails newコマンドって終わるっけ?
あれ??VScodeのディレクトリ少なすぎない??appファイルは?configファイルは?一体何が起こっているんだ!?!?

原因

いろいろ調べてみると
どうやら、先程の

    run  git init from "."

がヒントらしく、自分の場合はgitがインストールされていないよということだった。

そういえばVScodeで作業している時もなんか右下にGitがインストールされていませんと出ていたような、、、
いやでも最初の環境構築でGitの公式サイトからインストールしてないけどな、、どういうことだ??
環境構築の部分を見直す必要がありそうかな?

ということでターミナルにて

brew -v

で現在のhomebrewのところを見てみると

Homebrew >=2.5.0 (shallow or no git repository)
Homebrew/homebrew-core (no Git repository)

おっと、なんか (no Git respository)といかにもそうなのがでてきました!

解決した方法

解決した方法は単純にhomebrewを再度インストールするでした。

具体的には
1、homebrewの公式サイト(https://brew.sh/index_ja)
 にアクセス
2、トップページに大きくインストールと書かれている部分をコピーしてターミナルのホームディレクトリにて実行

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

3、再度brew -vコマンドを用いると

Homebrew 3.0.7
Homebrew/homebrew-core (git revision 173ea7530d; last commit 2021-03-22)

(no Git repository)じゃ無くなって問題解決!

実際にこの後も問題なくアプリを作成できました!

最後に

この記事が誰かの学習の後押しになれば幸いです。
この投稿が初めての投稿となります。
この記事についてまだまだ自分も未熟で、至らぬところも多々あるかとは思いますが、その際はご教授願えればと思います。
プログラミング学習は決して楽ではないですが、お互いに頑張っていきましょうね。

参照リンク先

https://git-scm.com/download/mac
https://qiita.com/kodai_0122/items/56168eaec28eb7b1b93b
https://qiita.com/Yuu94/items/a97490f57640587e0ac7
勉強になりました!ありがとうございました!

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?