Uninitialized Constant Rake::Dsl in Ruby Gem

uninitialized constant Rake::DSL in Ruby Gem

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

Ruby on Rails and Rake problems: uninitialized constant Rake::DSL

A tweet from DHH earlier. Rake .9.0 breaks Rails and several other things, you need to:

gem "rake", "0.8.7"

in your Gemfile.

Another: uninitialized constant Rake::DSL

There are answers like Ruby on Rails and Rake problems: uninitialized constant Rake::DSL and uninitialized constant Rake::DSL in Ruby Gem ... I would try this first:

# [...]
require 'rake/dsl_definition'
require 'rake'
# [...]

If that doesn't fix it completely, you may be able to put gem 'rake', '>=0.9.2' in your Gemfile, then do a bundle update, and finally run bundle exec rake db:migrate.

How to fix the uninitialized constant Rake::DSL problem on Heroku?

Put this in your Rakefile above require 'rake':

require 'rake/dsl_definition'

Ruby: Calling gem subclass within module produces uninitialized constant

Since you have a class called Common::RestClient and are using a ruby gem which defines a class RestClient, when you're within your Common module, you'll need to reference the gems RestClient with a :: prefix, otherwise, it assumes you're talking about Common::RestClient

module Common
module RestClient

def call_rest_service_get(url)
begin
response = ::RestClient.get(url, {accept: :json})
rescue ::RestClient::Exception => err
return err.response
else
return response
end
end
end


Related Topics



Leave a reply



Submit