Rails プロジェクトがあり、ディレクトリからすべてのファイルをロードしたいと考えています。"" rails c のように始めましたが、
No such file or directory
これが私のコードの例です:
class ParserPlugin < ApplicationController
def self.loadPlugins
a = File.new("1234")
Dir.foreach("/plugins") do |f|
if f != '.' and f != '..'
load("/plugins" + f.to_s)
end
end
end
def self.createplugin
@@plugins << self.new
end
end
ファイル構造は
/home/andrii/LV-081/app/controllers/admin/plugins
何かアドバイスをいただけますか?