danmayer/churn

Churn crashing on RubyMine 'get available generators list'

leebrooks0 opened this issue · 3 comments

Hi

When I try run a generator after installing Churn (I want to run Devise:Install), I cannot because Churn is crashing for some reason. I am running Ruby 2.0.0 and Rails 4.0.0.rc1.
A screenshot of the error message is below.

image

hmmm that implies that the rake task for churn is being loaded outside of the rake environment. Could you share some of how you are setting up the project?

How are you requiring and loading churn, could you share the gemfile and rakefile you are using? I think you might just need to add , :require => false after you gemfile entry for churn and then manually add the require churn to your rakefile. If that works let me know and I can update the documentation.

My Rails project is stock standard... I added :require => false (and did
not require churn), and the problem seems to have gone away?

I am calling Churn from a rake file in lib/task and it looks like this:

image

My gem file is as follows:

image

Awesome thanks for the info. That should work fine if you have :require => false it just won't load churn by default when booting bundle. If you do that and then explicitly add require 'churn' to your Rakefile everything should work for you. I actually would recommend that strategy as churn won't load when running a webserver, tests, etc, so it shouldn't add unnecessary code into memory. Adding the explicit require into the Rakefile will only load it when you are running your rake environment.

I update the readme to explain that a bit better, I also just released a new version 0.0.29 which will detect this issue and not load unless churn is booted in a rake environment. Feel free to upgrade or just continue using the preferred :require => false setup.

Thanks for the report and the info to track down and debug the problem.