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
Count Number of Days Between Two Dates
Where in the Ruby Language Is %Q, %W, etc., Defined
What Is '$:.Unshift File.Dirname(_File_)' Doing
In Ruby What Does "=>" Mean and How Does It Work
How to Avoid Putting the Magic Encoding Comment on Top of Every Utf-8 File in Ruby 1.9
What Would a Default Getter and Setter Look Like in Rails
How to Backreference in Ruby Regular Expression (Regex) with Gsub When I Use Grouping
Ruby Loaderror: Cannot Load Such File
Devise Custom Messages When Validation Fails
Devise: How to Override Devise Error Messages on Password Change
Rspec: How to Test If a Method Was Called
When to Use Curly Braces VS Parenthesis in Expect Rspec Method
Rebase Rails Migrations in a Long Running Project
How to Unfreeze an Object in Ruby
Cannot Load Such File -- Readline (Loaderror) When Running Heroku Create --Stack Cedar