On the 3.1RC, I have created a new app, and when I try to run the db:create job I'm getting this:
[15:38][*********#***********:~/**********/db(master)]$ rake db:create
(in /Users/*********/*********)
rake aborted!
uninitialized constant Rake::DSL
any ideas appreciated.
Use
gem "rake", "0.8.7"
In your gemfile, as stated rake 0.9.0 breaks a few things.
Related
I had create a empty new rails project with a scaffold successfully but when I try rake db:create, it throws me an error: rake aborted! uninitialized constant Rake::DSL.
As other SO post mentioned, I tried setting my Gemfile to gem 'rake', '0.8.7', but rake gives me another error:
You have requested: rake = 0.8.7
The bundle currently has rake locked at 0.9.2.2. Try running bundle
update rake Run bundle install to install missing gems.
Then I did as the message said and update rake and bundle install. Same error.
It is nice and easy experience to develop a project a rails but it is a nightmare porting between ruby versions, rails versions, difference gem and plugin versions..
Try to delete your Gemfile.lock, and type this on your terminal:
bundle install
I had create a empty new rails project with a scaffold successfully but when I try rake db:create, it throws me an error: rake aborted! uninitialized constant Rake::DSL.
for this problem I'd suggest running all rake tasks via bundle exec rake ...
I am using 'rake 0.8.7' in my Rails project and yet when I still try either rake routes or bundle exec rake routes I still get
rake aborted!
uninitialized constant Rake::DSL
If I try putting the recommended require 'rake/dsl_definition' in my Rakefile it gives me
rake aborted!
no such file to load -- rake/dsl_definition
So, I'm stuck at how to fix this. I can't run any rake commands...
That error sounds like you are using something in your app that requires a more recent version of rake than 0.8.7. Believe Rake::DSL only showed up in rake 0.9.0.
The most recent version of Rails advertises itself as working with rake as old as 0.8.7. Perhaps it's wrong. More likely you're using some other gem in your project which requires a more recent rake.
Why and how are you using rake 0.8.7 in your project instead of a more recent one? Unless you've locked to rake 0.8.7 in your gemfile (or are using some other gem that insists on 0.8.7), you should be able to run bundle update rake to upgrade to the most recent version of rake.
If you have multiple versions of rake installed, you may have to run bundle exec rake ..., as you noted. But in your project, bundle exec rake still gets you 0.8.7, because for whatever reason that's the version of rake your Gemfile.lock is currently set to -- but your project is using something that wants a more recent version.
I recently installed Rails 3.1 and now my old Rails 3.0 app won't rake db:migrate. This is what happens when I try to run bundle exec rake db:migrate. I'm on Ubuntu with no RVM
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:142:in `block in cripple_rubygems': can't find executable rake (Gem::Exception)
from /usr/local/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
When I run just rake db:migrate, it outputs:
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
(See full trace by running task with --trace)
which rake
/usr/local/bin/rake
Put this in your Gemfile:
gem 'rake' , '>= 0.9.2'
and run bundle update
you need to give more details in what environment you're running this:
which OS?
are you using RVM?
is this a brand new RVM setup per chance?
1) Try to run this:
gem list | rake
what output do you get?
2) If you don't see rake in the output, then do this:
gem install rake
and then try rake db:migrate again
3) If you see rake, but it still doesn't work, then do this:
which rake
what output do you get? it should look something like this:
~/.rvm/gems/ruby-1.9.2-p0/bin/rake
I'm running Ruby 1.9.2 and Rails 3.1 locally and I'm trying to fire up my app. Whenever I use rake (rake spec, rake cucumber, rake db:create) I get these warnings. What did I do wrong?
/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
Thanks for any pointers in the right direction!
This is caused when you are using Ruby 1.9.2 (that already comes with rake bundled) and you installed the rake gem, for example using bundler.
You can
uninstall the rake gem
$ gem uninstall rake
If you use bundler, keep using bundler. In this case, the right syntax is
$ bundle exec rake spec
not
$ rake spec
The warnings may fade if you prefix your calls to rake with bundle exec, i.e.
bundle exec rake spec
bundle exec rake cucumber
ian.
It seems to me that you've 1 unnecessary require 'rake' in your code
heroku rake db:migrate
rake aborted!
no such file to load -- acts_as_ferret
(See full trace by running task with --trace)
(in /disk1/home/slugs/310513_b4b7e61_4c01/mnt)
It show this message issue. how do I fixes this?
add gem in your gem file "acts_as_ferret"
bundle install
run heroku run rake db:migrate
Add the gem act_as_ferret gem.
But seems complicated in heroku environement without ferret.