memo.log

技術情報の雑なメモ

2023-06-01から1ヶ月間の記事一覧

【Ruby】MicroCMSで記事を全件取得するスニペット

# return [Array<OpenStruct>] def all_contents limit = 10 offset_number = 0 contents = [] loop do result = MicroCMS.list( "[MUST EDIT]", { offset: offset_number, limit: limit, } ) total_count = result.total_count contents << result.contents if total_co</openstruct>…

【Ruby】モジュールで定義されたメソッドをクラスメソッドにするときのメモ

require 'active_record' module Test1 def hoge "hoge1" end end module Test2 def hoge "hoge2" end end module Test3 extend ActiveSupport::Concern module ClassMethods def hoge3 "hoge3" end end end class Test extend Test1 extend Test2 # 後ろで…

ActiveRecord単体でSQLiteを使うメモ

確認環境 amzn2.x86_64 ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux] activerecord (7.0.5) sqlite3 (1.6.3-x86_64-linux) 名前 : sqlite アーキテクチャー : i686 バージョン : 3.7.17 インストール SQLite % sudo yum install sqlite …

WSL2で "WslRegisterDistribution failed with error"

これで解決。 windows-core.com

【CDK】yarn integ でDeployment failed: Error: xxxxxxxxxxxxxx: SSM parameter /cdk-bootstrap/xxxxxxxxxxxx/version not found. Has the environment been bootstrapped? Please run 'cdk bootstrap'

packages/@aws-cdk-testing/framework-integ の下で yarn integ すると結合試験を実行できる。その際、タイトルのエラーが出たので、 npx cdk bootstrap aws://xxxxxxxxxxxxx/us-east-1 してから再度実行したらエラー解消。 テストのファイルのあるパスに sn…