Related
After installing a new gem, Slackistrano to already succesfully deployed app with Capistrano, our deployments started failing with the following error during rake assets:precompile or rake db:migrate tasks
cap aborted!
SSHKit::Command::Failed: rake stdout: Nothing written
rake stderr: Nothing written
/Users/pete/.rvm/gems/ruby-2.2.2/gems/sshkit-1.3.0/lib/sshkit/command.rb:94:in `exit_status='
This error is obviously not very helpful.
If I ran the capistrano task cap staging assets:precompile, it would succeed.
So what's going on here?
There are a few other solutions to SSHKit failures during cap deployments, but most of them were for first time deployments and didn't work for me.
Here's how I figured out the solution(after much hair pulling).
I knew that it was probably the new gem that was causing the problem. So I went into the source code for sshkit/command.rb and outputted the command it was trying to execute on the remote server.
I then logged into the remote server and ran it manually and got the following output:
$ cd /home/web/sites/site.com/releases/20160106224143 && ( RAILS_ENV=production ~/.rvm/bin/rvm default do bundle exec rake db:migrate )
rake aborted!
NoMethodError: undefined method `each_pair' for "slack:deploy:updating":String
/home/web/sites/site.com/shared/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1602:in `compile!'
/home/web/sites/site.com/shared/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1344:in `add_filter'
/home/web/sites/site.com/shared/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1331:in `before'
/home/web/sites/site.com/shared/bundle/ruby/2.2.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1989:in `block (2 levels) in delegate'
/home/web/sites/site.com/shared/bundle/ruby/2.2.0/gems/slackistrano-1.0.0/lib/slackistrano/tasks/slack.rake:121:in `<top (required)>'
So, the problem started with Slackistrano, but then, what? why is Sinatra there? I don't use Sinatra in my app.
Well, I discovered that there was a gem in my Gemfile that was for development only(mailcatcher) but was in the production section of the Gemfile. I removed this and redeployed successfully.
However, there is obviously a deeper issue because there seems to be some sort of name collision on the "before" method of sinatra and capistrano that caused this in the first place.
I'm posting here to help others debug possible SSHKit errors during Cap deployments and also perhaps to guide others on weird name collisions between Sinatra and Capistrano.
For me this issue can arise if you're accidentally on an incompatible version of Ruby whilst running Capistrano. I had to add a .ruby-version to clamp it for me to 2.7.5 whilst using gem 'capistrano', '3.11.0'.
So I'm not sure if stating Ruby version 2 or higher is strictly true.
I've updated to Ruby 2.3.0 and I'm having some issues when creating a new Rails app. After creating a simple new test app and scaffolding a resource, when trying to execute rake db:migrate I'm getting the following load error:
MacBook-Pro:log medright1$ rake db:migrate
/Users/medright1/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rake-10.4.2/bin/rake:31:in `require': cannot load such file -- rake (LoadError)
from /Users/medright1/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rake-10.4.2/bin/rake:31:in `<top (required)>'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/rake:23:in `load'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/rake:23:in `<main>'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/medright1/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
MacBook-Pro:log medright1$
Any help sorting this would be great!
If you haven't done it yet, make sure you have all the dependencies installed.
$ bundle
or
$ bundle install
It's likely you don't have rake installed in the global RVM gemset. In any case, given you are within a Rails project, you should use bundler to execute the command.
$ bundle exec rake db:migrate
Otherwise, make sure to install rake globally
$ rvm gemset use global
$ gem install rake
However, the correct way is to execute the command via Bundler.
I'm having a really frustrating issue: Rake is being dumb.
Here's how the problem comes about:
$ rails new test_app
$ rails generate scaffold new_scaffold field1:string field2:text
Both of those work just fine, but then when I do this,
$ rake db:migrate
I get the following error.
(in /home/mikhail/test_app)
rake aborted!
uninitialized constant Rake::DSL
/usr/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:6:in `<module:Rake>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:3:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `require'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `require'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `load'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `block in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `each'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in `require'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in `initialize_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/mikhail/test_app/Rakefile:7:in `<top (required)>'
/usr/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/bin/rake:31:in `<main>'
I've looked about the Internet for similar/same errors, and people have had them. Just no one ever seems to solve the problem!
How do I fix this problem?
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.
I made some research just after my previous answer (sorry, I must do before it).
All problems are solved with Rake gem 0.9.2.. I followed these steps:
I installed gem install rake -v=0.9.2 (I had the 0.9.1 gem)
removed the 0.9.1 with gem uninstall rake -v=0.9.1
updated with bundle update
then the db:migrate showed a warning, WARNING: Global access to Rake DSL methods is deprecated. Please....
It was solved by adding the following to the Rake file.
module ::YourApplicationName
class Application
include Rake::DSL
end
end
I ommited the module ::RakeFileUtils extend Rake::FileUtilsExtend option sugested by #databyte.
It means that the Rake gem 0.9.2 works fine!
Going through Chapter 2 of Railstutorial (demo_app) and ran into this problem. I tried all of the other answers listed here, but couldn't get it to work until I did this:
Put this in your Rakefile above require 'rake':
require 'rake/dsl_definition'
via How to fix the uninitialized constant Rake::DSL problem on Heroku?
I also recommitted and pushed all files to Github and Heroku.
All I needed to do was use:
gem install rake
I had version 0.9.2 already, just needed installing.
Reinstall the rake gem and it should work fine:
gem uninstall rake -v=0.9.2
gem install rake -v=0.9.2
If not, specify version '0.8.7' in your Gemfile.
If not using Bundler:
sudo gem install rake -v 0.8.7
sudo gem uninstall rake
Then choose to uninstall 0.9.0.
If like me you're stuck on rake 0.8.7, and you're using Rails 3.2.x then railties adds a requirement for Rake::DSL
To solve this, to the top of your Rakefile you should add:
module Rake
module DSL
end
end
I solved the same problem with the following steps:
In Gemfile:
gem 'rake', '0.9.2'
Then ran this on the console:
sudo bundle update rake
Then added the following lines to Rakefile:
require 'rake/dsl_definition'
include Rake::DSL
Rails 3.1.rc1 has been updated. For your own Rakefiles, you can add this before the call to load_tasks.
module ::YourApplicationName
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
https://gist.github.com/4cd2bbe68f98f2f0249f
UPDATE: Also noticed it's already answered here as well: Undefined method 'task' using Rake 0.9.0
I had the same issue and had to use the rake 0.8.7 gem instead of 0.9.0.
I am a Windows XP user and I had the same problem.
I entered gem "rake", "0.8.7" into the gemfile, and then typed the following from the command window.
bundle update rake
This fixed my problem.
Go to your project path
Type bundle install --path=vendor/bundle
Type bundle exec rake db:migrate
To start server type bundle exec rails s. Use bundle exec and you will be sure that you use right gems (required version) for your project.
Also I would recommend you to add vendor/bundle to .gitignore if you use git and make alias for bundle exec. If you use zsh you can follow this approach
Same as Branstar above - thanks Branstar!
OS: Windows Vista
Level: Completely new to Ruby on Rails
I already had Ruby 1.9.2 installed
I followed the instructions in Running Rails 3 on Windows.
All worked up until the "rake db:migrate" part which gave me the same output as original post.
I ran:
gem install rake
I ran again:
rake db:migrate
Then I was able to start the Ruby on Rails server and had everything in place.
Thanks again Branstar :-)
I feel for you (mikhailvs), it's really frustrating. I have been going crazy for almost one full day. I even uninstalled Ruby and all its dependent files and shutdown my PC, but I still got the same problem.
What I got from the error message is the problem with Rake 0.9.2. It seems like it wasn’t fully installed. So I had to reinstall gem install rake -v=0.9.2
I wasn’t sure if I have rake –v0.9.1 installed. So to make sure I’m safe I tried to remove that old version with gem uninstall rake -v=0.9.1. But is showed me the error message
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d rake`
OK, so I checked all Rake directories on my PC, and found I only had Rake 0.9.2.
Then to check if everything went alright, I migrated with rake db:migrate. And it worked :)
I think I didn’t have Rake 0.9.1 because I clean-installed Ruby (rubyinstaller-1.9.2-p180 - on my Windows 7 system) and all gems as well. In the meantime Rake 0.9.2 wasn’t fully installed.
Uninstalling with "gem uninstall rake" worked for me, I had 2 versions installed, so I jest did a clean reinstall.
"rake db:create", to make sure the database exists
and then "rake db:migrate" to seal the deal.
I had the same issue using Rake 0.9.2.2. I solved this problem by using bundle exec.
For Rails 2.3 editing lib/tasks/rspec.rake like in this commit worked for me:
https://github.com/dchelimsky/rspec-rails/pull/11/files
Install rake 0.8.7 and uninstall 0.9.2.2
$ gem install rake -v 0.8.7
$ gem uninstall rake -v 0.9.2.2
Now use
$ bundle exec rake db:migrate
i think this will help you
;)
Run
bundle exec rake db:migrate
it works for me.
I am getting errors similar to the ones in these questions, except mine are occuring on Heroku:
2011-05-30T09:03:29+00:00 heroku[worker.1]: Starting process with command: `rake jobs:work`
2011-05-30T09:03:30+00:00 app[worker.1]: (in /app)
2011-05-30T09:03:30+00:00 heroku[worker.1]: State changed from starting to up
2011-05-30T09:03:33+00:00 app[worker.1]: rake aborted!
2011-05-30T09:03:33+00:00 app[worker.1]: uninitialized constant Rake::DSL
2011-05-30T09:03:33+00:00 app[worker.1]: /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
The answer in those questions seems to be to specify gem 'rake', '0.8.7' because the 0.9 version causes the problem.
When I try to add gem 'rake', '0.8.7' to my gemfile and push to Heroku I get this error:
Unresolved dependencies detected; Installing...
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have added to the Gemfile:
* rake (= 0.8.7)
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
error: hooks/pre-receive exited with error code 1
To git#heroku.com:my_app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:my_app.git'
My gemfile normally works fine on Heroku. What should I do?
Put this in your Rakefile above require 'rake':
require 'rake/dsl_definition'
Any time you change your Gemfile, you need to bundle install to update your lockfile (Gemfile.lock). The error you're getting on push is not specific to changing the version of rake.
bundle install
git commit -a -m "update lockfile"
git push heroku master
Note the error message you received:
You have modified your Gemfile in development but did not check the resulting snapshot (Gemfile.lock) into version control
I solved this, finally, after a lot of mucking about. The short version of what I did, missing out the many experiments, was this:
1) change the Gemfile to specify Rake 0.8.7
#in Gemfile
gem "rake", "0.8.7"
2) Take out a hack that I had previously added to Rakefile based on Stack Overflow question Ruby on Rails and Rake problems: uninitialized constant Rake::DSL:
So, my Rakefile is now back to being the standard Rakefile for my app:
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
MyApp::Application.load_tasks
3) Change Heroku to run my app in Ruby 1.9.2:
heroku stack:migrate bamboo-mri-1.9.2 --app myapp
git push heroku master
And it seems fine now - the scheduled cron task is running anyway.
EDIT: It did run fine, once, then blew up again next time I pushed something! Arrgh. I think I fixed it now, with the addition of the delayed_job gem, based on the conversation Don't know how to build task jobs:work.
Installing delayed_job doesn't seem like a great solution, but it HAS worked, and I might want to use it sometime I guess, especially with Heroku's once-per-hour cron job (which just isn't frequent enough - there are things I'll probably want to run every five minutes). After I installed the delayed_job gem I had to do the setup for it, otherwise Heroku complains about the missing delayed_jobs table:
#add to gemfile
gem 'delayed_job'
#at command line
bundle install
rails g delayed_job
rake db:migrate
git add -A
git commit -a -m "added delayed_job gem"
git push
heroku rake db:migrate --app myapp
heroku restart --app myapp
I had a Rails 3.0.11 app, which specified rake version 0.8.7 in the Gemfile to get around the version 0.9.2 Rake::DSL problem.
After I converted the app to Rails 3.2.0 (Heroku Cedar stack), I was having a problem with the worker (a rake task) crashing. I changed "gem 'rake', '0.8.7'" to "gem 'rake'", which bundled rake version 0.9.2.2. The worker stopped crashing with the new version.
Your problem is caused by not deleting the Gemfile.lock file and is not specific to Heroku. Deleting Gemfile.lock should fix this problem, but will lead you straight to another one:
To git#heroku.com:tailored-landing-pages.git
* [new branch] master -> master
manfred#painstation2:~/Desktop/projects/ror/ta/tlp307$ heroku rake db:migrate
rake aborted!
ninitialized constant Rake::DSL
/app/Rakefile:13:in `<class:Application>'
/app/Rakefile:12:in `<module:Tlp307>'
/app/Rakefile:11:in `<top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'
Unfortunately, I haven't found the solution for that problem yet, since downgrading Rake to 0.8.7 doesn't seem to work here. If somebody else has an answer, I would appreciate it very much.
I'm having a really frustrating issue: Rake is being dumb.
Here's how the problem comes about:
$ rails new test_app
$ rails generate scaffold new_scaffold field1:string field2:text
Both of those work just fine, but then when I do this,
$ rake db:migrate
I get the following error.
(in /home/mikhail/test_app)
rake aborted!
uninitialized constant Rake::DSL
/usr/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:6:in `<module:Rake>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:3:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `require'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.0/lib/rake/rdoctask.rb:20:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `require'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `load'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `block in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `each'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `<top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in `require'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in `initialize_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/mikhail/test_app/Rakefile:7:in `<top (required)>'
/usr/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/bin/rake:31:in `<main>'
I've looked about the Internet for similar/same errors, and people have had them. Just no one ever seems to solve the problem!
How do I fix this problem?
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.
I made some research just after my previous answer (sorry, I must do before it).
All problems are solved with Rake gem 0.9.2.. I followed these steps:
I installed gem install rake -v=0.9.2 (I had the 0.9.1 gem)
removed the 0.9.1 with gem uninstall rake -v=0.9.1
updated with bundle update
then the db:migrate showed a warning, WARNING: Global access to Rake DSL methods is deprecated. Please....
It was solved by adding the following to the Rake file.
module ::YourApplicationName
class Application
include Rake::DSL
end
end
I ommited the module ::RakeFileUtils extend Rake::FileUtilsExtend option sugested by #databyte.
It means that the Rake gem 0.9.2 works fine!
Going through Chapter 2 of Railstutorial (demo_app) and ran into this problem. I tried all of the other answers listed here, but couldn't get it to work until I did this:
Put this in your Rakefile above require 'rake':
require 'rake/dsl_definition'
via How to fix the uninitialized constant Rake::DSL problem on Heroku?
I also recommitted and pushed all files to Github and Heroku.
All I needed to do was use:
gem install rake
I had version 0.9.2 already, just needed installing.
Reinstall the rake gem and it should work fine:
gem uninstall rake -v=0.9.2
gem install rake -v=0.9.2
If not, specify version '0.8.7' in your Gemfile.
If not using Bundler:
sudo gem install rake -v 0.8.7
sudo gem uninstall rake
Then choose to uninstall 0.9.0.
If like me you're stuck on rake 0.8.7, and you're using Rails 3.2.x then railties adds a requirement for Rake::DSL
To solve this, to the top of your Rakefile you should add:
module Rake
module DSL
end
end
I solved the same problem with the following steps:
In Gemfile:
gem 'rake', '0.9.2'
Then ran this on the console:
sudo bundle update rake
Then added the following lines to Rakefile:
require 'rake/dsl_definition'
include Rake::DSL
Rails 3.1.rc1 has been updated. For your own Rakefiles, you can add this before the call to load_tasks.
module ::YourApplicationName
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
https://gist.github.com/4cd2bbe68f98f2f0249f
UPDATE: Also noticed it's already answered here as well: Undefined method 'task' using Rake 0.9.0
I had the same issue and had to use the rake 0.8.7 gem instead of 0.9.0.
I am a Windows XP user and I had the same problem.
I entered gem "rake", "0.8.7" into the gemfile, and then typed the following from the command window.
bundle update rake
This fixed my problem.
Go to your project path
Type bundle install --path=vendor/bundle
Type bundle exec rake db:migrate
To start server type bundle exec rails s. Use bundle exec and you will be sure that you use right gems (required version) for your project.
Also I would recommend you to add vendor/bundle to .gitignore if you use git and make alias for bundle exec. If you use zsh you can follow this approach
Same as Branstar above - thanks Branstar!
OS: Windows Vista
Level: Completely new to Ruby on Rails
I already had Ruby 1.9.2 installed
I followed the instructions in Running Rails 3 on Windows.
All worked up until the "rake db:migrate" part which gave me the same output as original post.
I ran:
gem install rake
I ran again:
rake db:migrate
Then I was able to start the Ruby on Rails server and had everything in place.
Thanks again Branstar :-)
I feel for you (mikhailvs), it's really frustrating. I have been going crazy for almost one full day. I even uninstalled Ruby and all its dependent files and shutdown my PC, but I still got the same problem.
What I got from the error message is the problem with Rake 0.9.2. It seems like it wasn’t fully installed. So I had to reinstall gem install rake -v=0.9.2
I wasn’t sure if I have rake –v0.9.1 installed. So to make sure I’m safe I tried to remove that old version with gem uninstall rake -v=0.9.1. But is showed me the error message
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d rake`
OK, so I checked all Rake directories on my PC, and found I only had Rake 0.9.2.
Then to check if everything went alright, I migrated with rake db:migrate. And it worked :)
I think I didn’t have Rake 0.9.1 because I clean-installed Ruby (rubyinstaller-1.9.2-p180 - on my Windows 7 system) and all gems as well. In the meantime Rake 0.9.2 wasn’t fully installed.
Uninstalling with "gem uninstall rake" worked for me, I had 2 versions installed, so I jest did a clean reinstall.
"rake db:create", to make sure the database exists
and then "rake db:migrate" to seal the deal.
I had the same issue using Rake 0.9.2.2. I solved this problem by using bundle exec.
For Rails 2.3 editing lib/tasks/rspec.rake like in this commit worked for me:
https://github.com/dchelimsky/rspec-rails/pull/11/files
Install rake 0.8.7 and uninstall 0.9.2.2
$ gem install rake -v 0.8.7
$ gem uninstall rake -v 0.9.2.2
Now use
$ bundle exec rake db:migrate
i think this will help you
;)
Run
bundle exec rake db:migrate
it works for me.