SpinaCMS / Spina

Spina CMS
http://www.spinacms.com
Other
2.19k stars 405 forks source link

Can't create plugins using rails 5.1 #304

Closed Otterpocket closed 6 years ago

Otterpocket commented 7 years ago

After creating a new engine/plugin if you have rails 5.1.* as a dependency, trying to create a model in the plugin yields the following error:

engine.rb:5:in block in <class:Engine>': uninitialized constant Spina::Plugin (NameError)

To reproduce, follow the creating a plugin guide here and change the version of the rails dependency.

kentarofujiy commented 7 years ago

I am having the same problem. Any known workaround?

Bramjetten commented 7 years ago

I think it has to do with load order. I'll have a look at it.

whatthefinemanual commented 6 years ago

By the ways. Do you run migrations from project root dir?

Otterpocket commented 6 years ago

@emilslv You run them from the plugin root directory

whatthefinemanual commented 6 years ago

@Otterpocket Try from project root directory

ngscheurich commented 6 years ago

Quick note: Simply putting a require "spina" at the top of my engine class seems to be working for me at the moment. I realize this isn't optimal, but could be an okay workaround until a proper fix is released.

Bramjetten commented 6 years ago

I looked into it and believe that adding require "spina" to the top of your engine.rb file is actually the way to go. I'm not sure why this was not necessary in the past, but I edited the wiki to reflect this change.