I have a gem that requires a ‘Cms’ namespace to be present when running.
However, when running rake tasks, nothing works as this Cms namespace isn’t present. How do I get my rake tasks to work?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can either, load your project source into the Rakefile (like Rails would do) or define a dummy module with the name Cms on your project.
If you are on rails, and this gem is a dependency, you just have to make your task dependent of the :environment rails’ task.
Hope this helps.