LoginSignup
0

More than 1 year has passed since last update.

posted at

【Rails】Refinery を導入する時に発生したエラー対応

はじめに

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.rbconfig.autoloader = :classicを追加する。

config/application.rb
module Rickrockstar
  class Application < Rails::Application
    config.load_defaults 6.0
    config.autoloader = :classic  # この行を追加する
  end
end

参考情報

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0