MacOS Monterey
Ruby 3.1.0
npm v 8.4.1
yarn -v 1.22.17
系統上沒有 Rails,它安裝了系統 ruby??。
我通過 asdf 安裝了 ruby??。當我調查
~/..asdf/installs/ruby
我懂了:
3.1.0
然后我做了一個 rails 7.0.2.2 安裝如下:
gem install rails -v 7.0.2.2
看起來一切正常,并且安裝了正確的寶石。最后的宣告是:
Successfully installed rails-7.0.2.2
然后我做了以下事情:
rails new myapp --database=mysql --skip-test --main --css=bootstrap
觀看安裝,以下內容沒有意義:
Using activesupport 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using activemodel 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using actionview 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using activejob 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using activerecord 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using actionpack 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using activestorage 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using railties 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using actioncable 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using actiontext 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using actionmailbox 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using actionmailer 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
Using rails 7.1.0.alpha from https://github.com/rails/rails.git (at main@cece807)
....
create config/initializers/new_framework_defaults_7_1.rb
....
remove config/initializers/new_framework_defaults_7_1.rb
然后當我打開 config/appliation.rb
我在里面找到了這個:
config.load_defaults 7.1
知道為什么會這樣嗎?rails 7.1.0(Alpha) 甚至都不存在。
uj5u.com熱心網友回復:
運行rails new --help將顯示傳遞--main標志將:
使用指向 Rails 存盤庫主分支的 Gemfile 設定應用程式
Github 上的當前版本是 7.1.0.alpha
如果要使用 7.0.2.2,只需洗掉--main標志
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/436022.html
標籤:轨道上的红宝石
