This project is archived and is in readonly mode.
rake tasks at different plugin path disappearing after rails update
-
İ. Emre Kutlu
... and I am using Rails 2.3.4
-
MatthewRudy
yeah,
I looked at this before.
but the problem seems to be that there is no way to load this information without loading up the Rails Environment.And, understandably, we don't want to load up the environment every time we run a rake any rake task...
So, only files in vendor/plugins and lib/tasks get loaded up,
therefore the hack is to place a file in you lib/tasks which just loads your extra rake files.
eg,
... didnt test this# lib/tasks/custom_plugin_tasks.rake Dir.glob("/../../vendor/new_folder/*/tasks/.rake").each do |rake_file| require rake_file end -
tvdeyen
- Tag set to engines, plugins, rake
- Title changed from rake tasks at different plugin path to rake tasks at different plugin path disappearing after rails update
It should be:
Dir.glob(File.dirname(__FILE__) + "/../../vendor/new_folder/**/tasks/*.rake").each do |rake_file| require rake_file endbut this is not working for me:
rake aborted! no such file to load -- FILENAMEThe File exists. Strange. But maybe this is only a local problem at my machine. What could this be? Anyone any clues?
Any new updates on this? I used Rails 2.1.2 for along time now with engines plugin and all rake tasks from my special folders worked fine. Now i updated my app to Rails 2.3.5 and all the rake tasks disappeared.
-
tvdeyen
I've got it!
It should be
importinstead ofrequire.
So, the rake file for including custom rakefiles in folders different fromvendor/plugins/should look like:# RAILS_ROOT/lib/tasks/custom_plugins_tasks.rake Dir.glob(File.dirname(__FILE__) + "/../../vendor/new_folder/**/tasks/*.rake").each do |rake_file| import rake_file end -
David Trasbo
- Assigned user set to Rohit Arondekar
I think this can be marked as
wontfix. It's a quite minor bug that very few people will stumble upon, and those who does can fix it themselves as described above. -
Rohit Arondekar
- State changed from new to wontfix
- Importance changed from to Low