Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to rails6.1.6 + ruby3.0.4 #425

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

telsaiori
Copy link
Collaborator

rails 版本: 6.1.6
ruby 版本: 3.0.4

  1. bundle update redis,解決想要跑任何東西都會跳下面錯誤
/Users/telsa/.rvm/gems/ruby-2.7.6/gems/redis-3.3.5/lib/redis/client.rb:121:in `call': ERR unknown command '_client' (Redis::CommandError)
  1. bundle update rails
    • Fix Gemfile dependencies

      • activerecord-postgis-adapter 改用 'activerecord-postgis-adapter', '~> 7.1'
      • webpacker 改成5.x
  2. 更改 bootsnap 版本為: gem 'bootsnap', '>= 1.12.0', require: false來修正問題
    /Users/telsa/.rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)
    
  3. 建立app/assets/config/manifest.js檔,解決Expected to find a manifest file錯誤,並新增以下到manifest檔案裡面
    //= link favicon/manifest.json  
    //= link favicon/browserconfig.xml  
    //= link application.js  
    //= link application.css
    
  4. DEPRECATION WARNING: action_view.raise_on_missing_translations is deprecated: test.rb 改成config.i18n.raise_on_missing_translations = true

@telsaiori telsaiori force-pushed the feature/upgrade_rails_ruby branch from ec11bf6 to caeec4e Compare June 22, 2022 08:13
@telsaiori telsaiori force-pushed the feature/upgrade_rails_ruby branch from f022c1c to d150f1d Compare June 22, 2022 08:54
Copy link
Member

@marsz marsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@telsaiori .idea 目錄下的那些是什麼?

Gemfile Outdated
gem 'tyr', path: 'tyr'

gem 'activerecord-postgis-adapter'
gem 'activerecord-postgis-adapter', '~> 7.1'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其實 tyr.gemspec 裡面已經有了
應該以 tyr 的為主, rails 本身就不用再追加這個 gem 了

//= link favicon/manifest.json
//= link favicon/browserconfig.xml
//= link application.js
//= link application.css
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//= link_tree ../images

感覺會需要?

@marsz
Copy link
Member

marsz commented Jun 30, 2022

@telsaiori 我看了一下 railsdiff https://railsdiff.org/5.2.8/6.1.6
有一些檔案也加一下好了

  • app/javascript/packs/application.js (確保 javascript_pack_tag 'application.js' 也可以正常載入)
  • app/jobs/application_job.rb (註解有需要)
  • bin/*
  • config.ru
  • config/application.rb
  • config/environments/*
  • config/initializers/*
  • config/spring.rb

@telsaiori telsaiori force-pushed the feature/upgrade_rails_ruby branch from fdd12bd to d56ce1e Compare July 4, 2022 08:13
@telsaiori
Copy link
Collaborator Author

@marsz

.idea 目錄下的那些是什麼?

那些是我的編輯器會自動產生的東西不小心把他丟上來,我砍掉了。

app/javascript/packs/application.js (確保 javascript_pack_tag 'application.js' 也可以正常載入)
app/jobs/application_job.rb (註解有需要)
bin/*
config.ru
config/application.rb
config/environments/*
config/initializers/*
config/spring.rb

1.app/javascript/packs/application.jsapp/jobs/application_job.rb 手動加上去了。
2. 剩下那些跑rails app:update補齊了,但有幾個檔案沒有讓他自動 overwrite :

  • routes.rb 維持原樣,不然會把scope module: 'api' do之類的都砍掉
  • config/application.rb手動改,不然也是會砍掉大部分原有的設定,比方config.action_mailer.delivery_method = :aws_sdk,基本上就是手動改成config.load_defaults 6.1 然後註解換成新的,其他照舊。
  • bin/spring會被刪掉,所以手動加回去
  • bin/rails bin/rake要把load File.expand_path("spring", __dir__)加回去

@telsaiori telsaiori requested a review from marsz July 7, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants