質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

2回答

1112閲覧

Ruby on rails ⇒ rails new booksをインスト-ルできない

y.minami

総合スコア2

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2022/12/26 03:13

編集2022/12/27 09:29

WindowsでRuby on railsの学習を始めました。

Ruby, Rails, SQlite3等のインスト-ル及び設定は完了し
アプリケーション用の雛形となる各種ファイルを自動生成する
為の"rails new books"をコマンドプロンプトで実行しましたがうまくいきません。

発生している問題・エラーメッセージ

該当のソースコード

C:/Ruby31-x64/lib/ruby/gems3.1.0/railties-7.0.4/lib/rails/
generators/rails/app/app_generator.rb:258:in``':No such file
or directory - git config init.dafaultbranch (Errno::ENOENT)

C:/のいろんな場所でrails new booksをコマンドプロンプトで実行
しましたが結果は変わらずでした。

よろしくお願いします。イメージ説明

***何を参考にしたか***
以下のチュートリアルをベースに学習を進めています。
JavaDrive 「Ruby on Rails入門 ~ アプリケーションの作成から実行までの手順」(著者:TATSUO IKURA)

***コマンドプロンプトエラ-内容テキスト***
Microsoft Windows [Version 10.0.22000.1335]
(c) Microsoft Corporation. All rights reserved.

C:\windows\system32>cd C:\Ruby31-x64

C:\Ruby31-x64>rails new books
create
create README.md
create Rakefile
create .ruby-version
create config.ru
create .gitignore
create .gitattributes
create Gemfile
run git init from "."
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/generators/rails/app/app_generator.rb:258:in ``': No such file or directory - git config init.defaultbranch (Errno::ENOENT)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/generators/rails/app/app_generator.rb:258:in user_default_branch' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/generators/rails/app/app_generator.rb:76:in version_control'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/generators/app_base.rb:134:in public_send' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/generators/app_base.rb:134:in build'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/generators/rails/app/app_generator.rb:328:in create_root_files' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in block in invoke_all'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in each' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in map'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in invoke_all' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/group.rb:232:in dispatch'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/base.rb:485:in start' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/application/application_command.rb:26:in perform'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in perform'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in invoke' from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/cli.rb:18:in <top (required)>'
from internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.4/exe/rails:10:in <top (required)>' from C:/Ruby31-x64/bin/rails:32:in load'
from C:/Ruby31-x64/bin/rails:32:in `<main>'

C:\Ruby31-x64>

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

m.ts10806

2022/12/26 04:15

何を参考に現在に至ったのでしょうか。
yuma.inaura

2022/12/26 05:01

エラーはテキストで貼っていただけると
m.ts10806

2022/12/26 06:39 編集

チュートリアルなら以下の方が。 https://railstutorial.jp/ 背景や環境まで言及されているもののほうが良いです。
guest

回答2

0

gitコマンドを入れていないのではないでしょうか?


あと、Windows上で直接動くRubyを使ってRails開発を行うのは、かなりの苦難の道です。WSLや仮想マシンなどでUnix系環境を用意することをおすすめします。

投稿2022/12/26 03:42

maisumakun

総合スコア145121

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

自己解決

C:\Users\ユーザ-名>rails new sample_app -G でinstallができました。

投稿2022/12/27 00:29

y.minami

総合スコア2

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問