When I run rake db:migrate
in Ubuntu Terminal I keep getting the error:
rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.
I saw on stackoverflow a way to solve this problem is to run:
bundle update rake
So I do this and I get:
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.6)
Using SystemTimer (1.2.3)
etc...
etc...
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
Isn't this supposed to update rake to 10.0.4? Because when I run rake db:migrate
I still get the error:
rake aborted!
You have already activated rake 10.0.4, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.
Any ideas how I can solve this problem? When I run gem env
I get:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/mycompaq/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
Could there be some conflict with the GEM PATHS? Thanks for any help.
you have tagged your question with
rvm
- so I assume you use RVM, but your gem env does not look like you used rvm installed ruby, to do it you need to run:rvm by default comes with
rubygems-bundler
gem which will automate thebundle exec
for you so it should be enough to:after rvm installed ruby was used, to make the ruby default for next sessions run:
in rare cases (like system installation or osx) you need to restart computer for this to take effect.
I always recommend to use "bundle exec" before any such commands