はじめに
RailsエンジンRefinery
というCMSが便利そうだと思ったので、すぐ使えるように試しに使ってみました。
その時に発生したエラーの解消方法を載せてみましたので、お困りの方は一読してみてください。
エラー1: LoadError: incompatible library version
実行コマンド
$ rails new rickrockstar -m https://www.refinerycms.com/t/edge
エラー内容
rake aborted!
LoadError: incompatible library version - /Users/user/.rbenv/gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
対応策
ffi
のバージョンが不整合なため、gem install
を実行する。
$ gem install ffi
エラー2: wrong constant name Refinerycms-authentication-devise
エラー内容
以下を実行すると、rails aborted!
というエラーが発生する。
$ rails new rickrockstar -m https://www.refinerycms.com/t/edge
rails aborted!
Zeitwerk::NameError: wrong constant name Refinerycms-authentication-devise inferred by Module from file
/Users/user/.rbenv/gems/2.6.0/bundler/gems/refinerycms-authentication-devise-4fbe5428ea2f/lib/refinerycms-authentication-devise.rb
Possible ways to address this:
* Tell Zeitwerk to ignore this particular file.
* Tell Zeitwerk to ignore one of its parent directories.
* Rename the file to comply with the naming conventions.
* Modify the inflector to handle this case.
....
Caused by:
NameError: wrong constant name Refinerycms-authentication-devise
対応策
config/application.rb
へconfig.autoloader = :classic
を追加する。
config/application.rb
module Rickrockstar
class Application < Rails::Application
config.load_defaults 6.0
config.autoloader = :classic # この行を追加する
end
end