Ruby on Rails上的项目创建不正确[重复]

ehxuflar  于 2023-08-04  发布在  Ruby
关注(0)|答案(1)|浏览(92)

此问题在此处已有答案

Error encountered when running rails new command(2个答案)
昨天关门了。
在ruby上创建项目时,我不创建文件夹,只创建文件。

E:\Gamess\Ruby>rails new blog
  create
  create  README.md
  create  Rakefile
  create  .ruby-version
  create  config.ru
  create  .gitignore
  create  .gitattributes
  create  Gemfile
     run  git init from "."

C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/generators/rails/app/app_generator.rb:258:in ``': No such file or directory - git config init.defaultbranch (Errno::ENOENT)
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/generators/rails/app/app_generator.rb:258:in `user_default_branch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/generators/rails/app/app_generator.rb:76:in `version_control'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/generators/app_base.rb:134:in `public_send'        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/generators/app_base.rb:134:in `build'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/generators/rails/app/app_generator.rb:328:in `create_root_files'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:134:in `block in invoke_all'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:134:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:134:in `map'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:134:in `invoke_all'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/group.rb:232:in `dispatch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/commands/application/application_command.rb:26:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/command/base.rb:87:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/command.rb:48:in `invoke'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/lib/rails/cli.rb:18:in `<top (required)>'
        from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.6/exe/rails:10:in `<top (required)>'
        from C:/Ruby30-x64/bin/rails:25:in `load'
        from C:/Ruby30-x64/bin/rails:25:in `<main>'

字符串
我尝试在其他文件夹中创建项目enter image description here

mec1mxoz

mec1mxoz1#

我以前见过这个错误。请安装Git,然后尝试创建新的Rails应用程序。

相关问题