uninitialized constant Rake::DSL in Ruby Gem

后端 未结 4 1215
礼貌的吻别
礼貌的吻别 2020-12-13 13:07

I have been working on updating my gem (whm_xml at https://github.com/ivanoats/whm_xml_api_ruby ) to make it work with ruby 1.9.2, latest rubygems, latest bundler, latest rd

相关标签:
4条回答
  • 2020-12-13 13:50

    I think this is something that happened with the rake 0.9.0 release. Try putting this in your Gemfile: gem 'rake', '0.8.7'

    Update

    You could try adding

    include Rake::DSL if defined?(Rake::DSL)
    

    to your app; it worked for my Rails app at one point.

    0 讨论(0)
  • 2020-12-13 14:00

    This SO Question might help you out. The suggestion there is to add require 'rake/dsl_definition' above require 'rake' in your Rakefile.

    0 讨论(0)
  • 2020-12-13 14:06

    I had the same problem with 0.9.1, installed the 0.9.2 and it worked but the db:migrate command sent a message WARNING: Global access to Rake DSL methods is deprecated. Please.... it got solved adding to the rake file module ::yourappname class Application include Rake::DSL end end and require 'rake/dsl_definition' before the .. LoadTask entry

    0 讨论(0)
  • 2020-12-13 14:11

    I fooled around with the include Rake::DSL, etc and just got other errors.

    adding

    gem 'rake', '0.8.7'

    to the Gemfile seems to work for me

    0 讨论(0)
提交回复
热议问题