質問

I followed some instructions, which I'm unable to locate again, to move my plugins to the "lib" directory.

So I have this structure now:

/lib
/lib/plugins
/lib/plugins/plugin1
/lib/plugins/plugin1/lib
/lib/plugins/plugin1/lib/plugin1.rb

I had tried this in my application.rb:

config.autoload_paths += %W(#{config.root}/lib #{config.root}/lib/plugins)

But that isn't working. What am I doing wrong?

UPDATE:

Trashing the plugins part of the path and putting the plugins directory directly in doesn't work either. Each plugin has an init.rb file that basically requires the main library, also.

役に立ちましたか?

解決

I'm not sure if these are the instructions you were following, but you probably want the plugin folder itself at the root of lib:

/lib
/lib/plugin1
/lib/plugin1/plugin1.rb

You also may need an initializer: config/initializers/plugin1.rb.

If that doesn't help, please post more information about what you're expecting to see and why it's not working.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top