我想開始學習 Ruby on Rails。我已經通過 RVM 安裝了 ruby?? 2.7.0。SQLite3 也默認安裝在 ubuntu 20.04.3 LTS 中。我的 Rails 版本是 7.0.2.2。當我運行命令時:
rails new blog
來自本指南: https ://guides.rubyonrails.org/getting_started.html
它拋出一個錯誤:
lou@lou-VirtualBox:~$ 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 "."
Traceback (most recent call last):
27: from /home/lou/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
26: from /home/lou/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
25: from /home/lou/.rvm/gems/ruby-2.7.0/bin/rails:23:in `<main>'
24: from /home/lou/.rvm/gems/ruby-2.7.0/bin/rails:23:in `load'
23: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/exe/rails:10:in `<top (required)>'
22: from /home/lou/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
21: from /home/lou/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
20: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/cli.rb:18:in `<top (required)>'
19: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/command.rb:48:in `invoke'
18: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/command/base.rb:87:in `perform'
17: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
16: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
15: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
14: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/commands/application/application_command.rb:26:in `perform'
13: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
12: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/group.rb:232:in `dispatch'
11: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `invoke_all'
10: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `map'
9: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `each'
8: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `block in invoke_all'
7: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
6: from /home/lou/.rvm/gems/ruby-2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
5: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/generators/rails/app/app_generator.rb:328:in `create_root_files'
4: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/generators/app_base.rb:134:in `build'
3: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/generators/app_base.rb:134:in `public_send'
2: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/generators/rails/app/app_generator.rb:76:in `version_control'
1: from /home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/generators/rails/app/app_generator.rb:258:in `user_default_branch'
/home/lou/.rvm/gems/ruby-2.7.0/gems/railties-7.0.2.2/lib/rails/generators/rails/app/app_generator.rb:258:in ``': No such file or directory - git (Errno::ENOENT)
我找不到與我相關的問題,所以我希望有人可以幫助我。
uj5u.com熱心網友回復:
我解決了我的問題。看起來它也需要安裝 git。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/436025.html
標籤:轨道上的红宝石 红宝石 ruby-on-rails-7
