Search code examples
ruby-on-railsrubyrakebundle

How to make rake work when bundle is incomplete (not all gems are installed successfully)?


I have a gem that does not install properly (probably due to system incompatabilities). Each time I call rake, it returns "cound not find rmagic in any of the sources. run bundle install".

I want push the app to Heroku later. But I have some database to seed first. Is it possible to force rake to go with tasks anyway, despite of the missing gem and without installing it?


Solution

  • Is this possible? Yes, you can disable bundler by removing the lines that look like this in your config/application.rb

    if defined?(Bundler)
      # If you precompile assets before deploying to production, use this line
      Bundler.require(*Rails.groups(:assets => %w(development test)))
      # If you want your assets lazily compiled in production, use this line
      # Bundler.require(:default, :assets, Rails.env)
    end
    

    I do not recommend this, as you'll need to start gem/dependency management on your own. But, it might be enough to get rake to load and work for you, provided you don't need to actually run any code.

    I highly recommend you just install image-magick and then rmagick. http://www.imagemagick.org/