Christian Eric Cosca
Christian Eric Cosca

Reputation: 23

Issues regarding the 'rails new' command

I am encountering issues when creating a new application on Ruby On Rails.

Whenever I get create a new application on Ruby on Rails, my file was not created successfully because of the following error in my command line:

C:\>rails new test_file
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.2.3/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.2.3/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.2.3/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.2.3/lib/rails/generators/app_base.rb:134:in `public_send'         from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.2.3/lib/rails/generators/app_base.rb:134:in `build'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.2.3/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.2.3/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.2.3/lib/rails/command/base.rb:87:in `perform'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.2.3/lib/rails/command.rb:48:in `invoke'         from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/railties-7.0.2.3/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.2.3/exe/rails:10:in `<top (required)>'         from C:/Ruby31-x64/bin/rails:32:in `load'
from C:/Ruby31-x64/bin/rails:32:in \`\<main\>'

Upvotes: 1

Views: 465

Answers (1)

popilion
popilion

Reputation: 26

The error is due to this line:

run git init from "."

Seems you need to install git.

Upvotes: 1

Related Questions