趣å³ã§åããã¦ããRails6.0.xãRuby 2.7.1ã®ã¢ããª3ã¤ãRails 6.1ãRuby 3.0.0(rc1)ã«ã¾ã§ä¸ãããã¨è©¦ã¿ãã ãã®ã¨ãã«ééããåé¡ãã¾ã¨ãããã®ã
ã²ã¨ã¾ãRails 6.1ãRuby 2.7.2ã¾ã§ä¸ãããã¨ã«ããã 以ä¸ããã®éç¨ã§è¸ãã åé¡ã
rails aborted! LoadError: cannot load such file -- listen
rails app:update
ãå©ããã¨ãã«åºã¦ããã
gem 'listen'
ã追å ã
Rails 6.1ã¯ActiveStorageå¨ãã®ã¹ãã¼ããå¤ãã£ã¦ãã¦ã rails app:update
ãå®è¡ããã¨ãã¤ã°ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã追å ãããã®ã§å®è¡ããå¿ããªãã
NoMethodError: undefined method `parent' for MyApplication::Application:Class
rails db:migrate
ãå®è¡ããã¨ãã«rails-erdã§åºãã
Rails 6.1 support · Issue #363 · voormedia/rails-erd · GitHub ã®éããissueã¯ç«ã£ã¦ãããä½è
ã1å¹´ãããæ´æ°ãã¦ãªãã®ã§æ´æ°ããããæã¿èã
ã¨ãããããã©ã¼ã¯çã§ä¿®æ£ãã¦ããã¦ããã®ã§ããã使ãããã«ããã
gem 'rails-erd', github: 'guapolo/rails-erd'
uninitialized constant NestedForm::BuilderMixin (NameError)
åãã rails db:migrate
ã®æã«çºçãrails_admin
ã®åé¡ã®æ§åã
config/initializers/rails_admin.rb
ã«2è¡ã®requireã追å ããã
refs: uninitialized constant NestedForm::BuilderMixin · Issue #887 · sferik/rails_admin · GitHub
require "nested_form/engine" require "nested_form/builder_mixin"
NoMethodError: undefined method `assert_nothing_raised'
RSpecã®SystemSpecã§åºãããã«ãªã£ã¦ããã
rspec - Rails 6.1 upgrade: undefined method `assert_nothing_raised' - Stack Overflow
ããã¨åãåé¡ã ã£ãã®ã§spec/rails_helper.rb
ã«ä»¥ä¸ã追å
config.include ActiveSupport::Testing::Assertions
SystemStackError - stack level too deep
developmentã§è©¦ãã«åä½ç¢ºèªãããã¨ãããåºãã
stacktraceçã« meta_request
ã¨ããGemãæªããã£ãã®ã§è©¦ãã«ãªãã«ããã解決ã
ç¹ã«ä½¿ã£ã¦ããªãã£ãã®ã§ãã®ã¾ã¾åé¤ã
activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:174:in `block in as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:173:in `each' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:173:in `as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:57:in `as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:174:in `block in as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:173:in `each' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:173:in `as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:174:in `block in as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:173:in `each' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:173:in `as_json' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:57:in `as_json' activesupport (6.1.0) lib/active_support/json/encoding.rb:35:in `encode' activesupport (6.1.0) lib/active_support/json/encoding.rb:22:in `encode' activesupport (6.1.0) lib/active_support/core_ext/object/json.rb:42:in `to_json' meta_request (0.7.2) lib/meta_request/event.rb:46:in `block in json_encodable' meta_request (0.7.2) lib/meta_request/event.rb:66:in `block in transform_hash' meta_request (0.7.2) lib/meta_request/event.rb:60:in `each' meta_request (0.7.2) lib/meta_request/event.rb:60:in `inject' meta_request (0.7.2) lib/meta_request/event.rb:60:in `transform_hash' meta_request (0.7.2) lib/meta_request/event.rb:38:in `json_encodable' meta_request (0.7.2) lib/meta_request/event.rb:15:in `initialize' meta_request (0.7.2) lib/meta_request/app_notifications.rb:69:in `new' meta_request (0.7.2) lib/meta_request/app_notifications.rb:69:in `block in subscribe' meta_request (0.7.2) lib/meta_request/app_notifications.rb:81:in `block in subscribe'
NameError: uninitialized constant ActiveJob::Logging::LogSubscriber
ActiveJobã®å¼æ°ã«å·¨å¤§ãªå¤ãæå®ããã¨ãã°ãä¸ç¬ã§åã¾ãã®ã§snipããããã«æãã§ããã 6.0.xãã6.1ã§ãã®è¾ºãå¤ãã£ã¦ããã¿ããã
diff --git a/config/initializers/active_job_custom_logger.rb b/config/initializers/active_job_custom_logger.rb index 1b352a6..856338a 100644 --- a/config/initializers/active_job_custom_logger.rb +++ b/config/initializers/active_job_custom_logger.rb @@ -1,4 +1,4 @@ -require 'active_job/logging' +require 'active_job/log_subscriber' module ActiveJobCustomLogger def args_info(job) @@ -9,4 +9,4 @@ module ActiveJobCustomLogger end end -ActiveJob::Logging::LogSubscriber.prepend(ActiveJobCustomLogger) +ActiveJob::LogSubscriber.prepend(ActiveJobCustomLogger)
ArgumentError: You tried to define an enum named "bar_status" on the model "Hoge", but this will generate a instance method "_?", which is already defined by another enum.
enumå¤ã«æ¥æ¬èªã使ã£ã¦ãã¨(æ£ç¢ºã«ã¯è±æ°å以å¤ã使ã£ã¦ããã¨)æ£è¦è¡¨ç¾ã§æ¶ããã¦ãã¾ã£ã¦éè¤ã¡ã½ããæ±ãã«ãªãã¨ã©ã¼ã¨ãªãã https://github.com/rails/rails/blob/v6.1.0/activerecord/lib/active_record/enum.rb#L205
ä¸å¿issueã«ã³ã¡ã³ãã ããããã©ãã³ã¼ãã¼ã±ã¼ã¹ãããã®ã§ããããã³ã¡ã³ãããããæ©ãã â¦ã èæ¯çã«ã¯ãã¼ã«ã©ã¤ãºãå¿ è¦ãªã(ããäºå®ããªã)ã®ã§ãã®ã¾ã¾æ¥æ¬èªãå ¥ãã¦ããã
https://github.com/rails/rails/issues/40804#issuecomment-751440989
2021/01/09追è¨
kamipoããã6.1.1ã§ç´ãã¦ããããæè¬ã
manifest unknown
Ruby, Railsã¨ç´æ¥é¢ä¿ãªããã«ãã¹ã masterã«ãã¼ã¸ãã¦imageãä½ãéã«åºãã
ruby:2.7.2-alpine3.10
ãªãã¦ã¤ã¡ã¼ã¸ã¯ãªãã®ã§ ruby:2.7.2-alpine3.12
ã«ä¿®æ£ã
Step 1/22 : FROM ruby:2.7.2-alpine3.10 manifest for ruby:2.7.2-alpine3.10 not found: manifest unknown: manifest unknown
rails aborted! LoadError: Error loading shared library liblzma.so.5: No such file or directory (needed by /usr/local/bundle/gems/nokogiri-1.10.10/lib/nokogiri/nokogiri.so) - /usr/local/bundle/gems/nokogiri-1.10.10/lib/nokogiri/nokogiri.so
Rails 6.1ãRuby 2.7.2ã®æ®µéã§ä¸åãããã¤ãã¦ãããã 趣å³ãªã®ã§å¤å°ã¨ã©ã¼ãåºã¦ãè¯ãããRuby 3ã«é¢ä¿ãªãã¨ããã§åé¡ããããªãåãåãã¦ç¢ºèªãã¦ããããããã
ã©ããã§è¦ããã¨ãããã¨ã©ã¼ã prodç°å¢ã® rails db:migrate
æã«çºçã
alpineã ã¨ãããã¡ãªã¤ã¡ã¼ã¸ããã£ãã®ã§ãã®æ©ä¼ã«slim-busterã«ç§»è¡ããã
ã¤ã¡ã¼ã¸ãµã¤ãºã135MB->285MBã«ãªã£ã¦ãã¾ã£ãâ¦ã ã¨ã¯ããç¹ã«åé¡ãªãæ®éã«åãã®ãã³ã³ããã®ããã¨ããã
Ruby 3å
ãã¼ã¸ã§ã³ç®¡çã«asdfã使ã£ã¦ãããã3.0.0ãé¸ã¹ãªãã£ãã®ã§èª¿ã¹ã¦ããããã«è¡ãçããã
Increment ruby-build for Ruby 3.0.0 support by f440 · Pull Request #192 · asdf-vm/asdf-ruby · GitHub
ASDF_RUBY_BUILD_VERSION=v20201225 asdf install ruby 3.0.0
ã§ã¤ã³ã¹ãã¼ã«ã
ã¾ãèµ·åãããã¨ããã¨cannot load such file -- webrick/httputils (LoadError)
ãåºãã
å
¨ãå¿å½ãããç¡ãã®ã§stacktraceãè¦ãã¨ã
/vendor/bundle/ruby/3.0.0/gems/mechanize-2.7.6/lib/mechanize.rb:12:in `<main>
太å¤ã«ä½¿ã£ã¦ãGemãªã®ã§åé¤ã
次㫠cannot load such file -- binding_of_caller.bundle (LoadError)
ãåºãã
stacktraceãè¦ãã¨ã
/vendor/bundle/ruby/3.0.0/gems/binding_of_caller-0.8.0/lib/binding_of_caller.rb:9:in `<main>'
BetterErrorsã使ãããã«å ¥ãã¦ãããã©ã試ãã«æ¶ãã¦ã¿ãã Gemfile.lockãè¦ãã¨ã
pry-stack_explorer (0.5.1) binding_of_caller (~> 0.7)
ã®ä¾åã§ã¾ã æ®ã£ã¦ããã®ã§pry-stack_explorerãæ¶ãã ããã§ããããrails sã§èµ·åããããã«ãªã£ãã
æè¿ã¯irbãé²åãã¦ãããproductionã§ã¯pryã使ã£ã¦ãªãã®ã§irbã«ç§»è¡ãããã BetterErrorsã便å©ã ã£ããã©web-consoleã§ååããªãã¨ããææ¨é¢ã®æ°æã¡ãå¾ãããã Rails触ãã¯ããã®é ã«ä½¿ã£ãã¢ããªãªã®ã§ä¸è¦ãªgemãããããå ¥ã£ã¦ãã¾ã£ã¦ããâ¦ã
web-consoleã¯Vimiumã¨å¹²æ¸ãã¦ã¾ã¨ãã«ã¿ã¤ãã§ããªããã¨ãä¸çªãã¤ãã jsã§å ¥åãã¼ãåå¾ãã¦preã¿ã°ã®ä¸ã§å ¥ãè¾¼ããããªæåã«ãªã£ã¦ãããããªã®ã§ãç´ ç´ã«inputã¿ã°ã«ãã¦ãããã大ä¸å¤«ããã ãã©ãè²ã ããã¯ããã¦ãã£ã½ãã®ã§ããããããâ¦ã ãããã¯ä¸æçã«Vimiumããªãã«ããã·ã§ã¼ãã«ãããã¼ãªã©ãããã°ããã§å¯¾å¿ããå½¢ã«ãªããâ¦ã
Rubyå
¬å¼ããã¹ãç¨ã® circleci/ruby
ãRCçãããªãã£ãã®ã§ä¸æ¦RC1ã®ã¤ã¡ã¼ã¸ã使ãããã«ããã
ruby:3.0.0-rc1-slim-busterã«ã¯gitãå ¥ã£ã¦ããªãã£ãã®ã§ãgitãapt-get installã«è¿½å ã ãã®ç¶æ ã§ãããã¤ãã¦ç¹ã«åé¡ãªãåä½ããã®ã§ããã¨ã¯æ£å¼çã®ã¤ã¡ã¼ã¸ãåºããåãæ¿ãããããªãã¨ãããããã ã¡ããã¡ããåããªããã®ããã£ã¦ææ¨é¢ããããã©ãçµæçã«è¯ãã£ãæ°ãããã
å
¨ä½ã®ææã¨ãã¦ã¯ä¾åãå¤ããªãã»ã©ã¢ãããã¼ãã®ã¨ãã«å¤§å¤ã§éç¨ã³ã¹ãããããã®ã§æ¥µåä¾åãå¢ãããã«ãã®ãä½ããã¨ããæ°æã¡ã«æ¹ãã¦ãªã£ãã
ãã¨è¤æ°ã¢ããªã§æ´æ°ä½æ¥ããã¦ã㨠rails app:update
ã®å®è¡ã§ config/environments
ã®å·®åãã¡ããã¨åæ ããä½æ¥ãä¸çªç²¾ç¥çã«å¤§å¤ã ã£ãã
ã«ã¹ã¿ã è¨å®ã¯æ«å°¾ã«è¨è¼ãã¦ãªãã¹ãå·®ååæ ã®å½±é¿ãåããªãã¨ããã«ç½®ãã¦ããã®ãããã®ãããããªãã