我正在建立第一個Rails 3的發動機,目前我收到以下錯誤消息問題產生的Rails 3引擎
is a Railtie/Engine and cannot be installed as plugin (RuntimeError)
爲了給你多一點背景,我不是做引擎作爲一個寶石,但我已經將引擎文件放置在供應商/插件文件夾中。我知道在插件文件夾中加載時存在問題,但我不清楚如何解決問題。在發動機
我的Rails/init.rb文件具有下面的代碼
require 'rails'
module RailsApp
module MyEngine
class Engine < Rails::Engine
config.after_initialize do
RailsApp::GameType.register do |game_type|
game_type.name = "TreasureIsland"
game_type.version = "0.1"
game_type.thumbnail = "teasure_island.jpg"
end
end
end
end
end
建議?
爲什麼你到底是試圖把在供應商/插件引擎?沒有把它發展成寶石的原因是什麼?爲什麼不只是發展成寶石? – johnmcaliley 2010-09-17 17:32:10
我可以這樣做。沒有特別的原因,我沒有這樣做,但只是認爲它的目的是以任何方式工作? – 2010-09-18 09:48:14