I just updated Rake to the latest version (0.9.0.beta.4) and the rake command ends up with the following error message:
rake aborted!
undefined method `task' for #<Anelis::Application:0x9223b6c>
Here is the trace:
undefined method `task' for #<Anelis::Application:0x97ef80c>
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb:214:in `initialize_tasks'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb:139:in `load_tasks'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
/home/amokrane/Documents/prog/web/learning_rails/anelis/Rakefile:7:in `load_string'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/environment.rb:28:in `eval'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/environment.rb:28:in `load_string'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/environment.rb:16:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:495:in `raw_load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:78:in `block in load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:77:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:61:in `block in run'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/lib/rake/application.rb:59:in `run'
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0.beta.4/bin/rake:31:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p136/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p136/bin/rake:19:in `<main>'
Anyone experienced the same issue? What could possibly be wrong? Note that I am running Rails 3.0.3, you may also be interested in the content of my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'mysql2'
gem 'legacy_data'
gem 'resources_controller', :git => 'git://github.com/ianwhite/resources_controller'
gem 'will_paginate', '3.0.pre' # pagination
gem 'jquery-rails', '>= 0.2.6'
gem "rmagick" # sudo aptitude install libmagick9-dev
gem "paperclip", "~> 2.3"
gem "nested_form", :git => "git://github.com/madebydna/nested_form.git"
gem "meta_search"
gem "hirb"
gem "devise"
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"
How can I fix this problem?
As explained in mordaroso's answer, there is a problem in Rake 0.9.0. You need to temporarily downgrade Rake in order to avoid it:
run: gem uninstall rake -v 0.9 (add sudo unless you use rvm)
add to your Gemfile: gem 'rake', '~> 0.8.7'
and then run: bundle update
You can skip the first step, but then you have to run rake using bundle exec, for example:
bundle exec rake db:migrate
Otherwise you get the following error.
rake aborted!
You have already activated rake 0.9.0, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
Update
As Alex Chaffee noticed in a comment for Pablo Cantero's answer, that you might need to do the following to uninstall Rake if you still see the problem
rvm use #global && gem uninstall rake -v 0.9.0
rvm use # && gem uninstall rake -v 0.9.0
Also try the solution suggested in Duke's answer.
I had the same exception when running the 0.9.0.beta.4 version of Rake.
It looks like the new Rake::DSL is not loaded properly.
So I added following code to my Rakefile:
require 'rake'
# Rake Fix Code start
# NOTE: change 'Anelis' to your app's module name (see config/application.rb)
module ::Anelis
class Application
include Rake::DSL
end
end
module ::RakeFileUtils
extend Rake::FileUtilsExt
end
# Rake Fix Code end
MyApp::Application.load_tasks
That way I was able to run my Rake tasks again.
I know that this is not a elegant solution. But if you have to use the --pre version of Rake it might be all right to use this quick hack.
Note: This was just fixed in Rails 3.0.8
The new version of Rake does not put its DSL commands (task, file, desc, import, etc.) in the root of the Object namespace anymore (placing them in Object meant every object has a task command, not very nice. The DSL commands are available by mixing in the Rake::DSL module into any module needing the commands.
Until Ruby on Rails is updated to work with Rake 0.9.x, put the following in your project Rakefile after "require rake" and before the call to Application.load_tasks:
class Rails::Application
include Rake::DSL if defined?(Rake::DSL)
end
I've created an issue for rails_admin about this same error.
The answer:
This is a general Rails problem: http://twitter.com/dhh/status/71966528744071169
There should be a 3.0.8 release soon that fixes it. In the mean time, you can add the following line to your Gemfile:
gem 'rake', '~> 0.8.7'
It's a problem in Rake (0.9.0), it was announced by DHH on Twitter.
Rake 0.9, which was released yesterday, broke Rails (and others). While we wait for a fix, you'll want gem 'rake', '0.8.7' in your Gemfile.
This has been fixed in Ruby on Rails 3.0.8.rc1 which should be released in a few days time.
Rake 0.9.1 has just been released which reverses the change that caused this error but adds a deprecation warning: https://github.com/jimweirich/rake/commit/44aec3ceac085740bce0c385bccd65fc4d1d911c
I use rvm, but uninstalling doesn't help me. So I manually remove all 0.9 files from .rvm/gems/ruby#global directory and everything becomes as before!
without the need to uninstall Rake 0.9.x, add
gem 'rake', '~> 0.8.7'
to your Gemfile and just type
bundle exec rake -T
Related
$bundle exec rspec spec/
Could not find rake-0.9.2.2 in any of the sources
Run `bundle install` to install missing gems.
I'm totally new to Rails and trying to read the tutorial: http://ruby.railstutorial.org/chapters/static-pages#sec:TDD
However, when I try to run rspect, I get that error.
Any ideas on what I'm doing wrong?
EDIT My Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'sqlite3', '1.3.5'
gem 'rake', '0.9.2.2'
group :development do
gem 'rspec-rails', '2.8.1'
end
group :test do
gem 'rspec-rails', '2.8.1'
gem 'webrat', '0.7.3'
end
gem 'jquery-rails'
You might want to add
gem "rake", '0.9.2.2'
to your gemfile (under gem 'rails' or what so ever..).
Run bundle install afterwards
Then run bundle exec rspec spec at last.
Will this work for you? If not, any error messages?
If there are error messages please type rake -V and bundle exec rake -V in your console and share us the versions!
I took a look about this problem within the list of question but nothing helped.
This is my first question in stackoverflow so please accept my apologies in case I do something wrong. Also I still have a lot of english to improve.
I'm installing Spree following the github instructions
$ gem install spree
$ rails new my_store
$ spree install my_store
when I get this message
...
Admin Password [spree123]
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
run bundle install from "./my_store"
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
precompiling assets
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
...
Well, as the guide suggests, in case of circular dependency issues do:
$ gem install spree_cmd
$spree install my_store -A
gemfile spree
gemfile spree_usa_epay
gemfile spree_skrill
run bundle install from "./my_store"
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
precompiling assets
git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install`
I changed directory to the app and run the command:
$cd my_store
$bundle install
and I get the following error
Bundler could not find compatible versions for gem "rails":
In Gemfile:
spree_usa_epay (>= 0) ruby depends on
rails (<= 3.1.3, >= 3.1.1) ruby
rails (3.2.1)
after this I changed the gem file to work with rails 3.1.3 and coffeescript gems and repeat the whole process again and I get this.
Users/Snake/.rvm/gems/ruby-1.9.3-p0/gems/activerecord- 3.1.3/lib/active_record/base.rb:1088:in `method_missing': undefined method `mass_assignment_sanitizer=' for ActiveRecord::Base:Class (NoMethodError)
from /Users/Snake/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/railtie.rb:59:in `block (3 levels) in <class:Railtie>'
It think it might be something with version of rails a spree but I don't know were to start.
Does anybody had this issue before?
I running Mac OS X 10.5.8
rails 3.2.1
ruby 1.9.3p0 (2011-10-30 revision 33570) [i386-darwin9.8.0]
ImageMagick #6.7.4-6_0+q16
As #Anatoly Ruchka suggested the problem was using rails 3.2.1, so I switched to 3.1.3.
This is what I did, I found a post of #vonconrad where he explain how to create a rail project without touch the installation.
1) I create a directory folder for my project:
$mkdir old_rails313
$cd old_rails313
$touch gemfile
$nano gemfile
2)
I pasted a gemfile definition specifying as you mention the version of rails I want, so it looks like this
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "rspec-rails", ">= 2.8.0.rc1", :group => [:development, :test]
gem "factory_girl_rails", ">= 1.4.0", :group => :test
gem "cucumber-rails", ">= 1.2.0", :group => :test
gem "capybara", ">= 1.1.2", :group => :test
gem "database_cleaner", ">= 0.7.0", :group => :test
gem "launchy", ">= 2.0.5", :group => :test
#gem "devise", ">= 1.5.0"
gem 'spree','1.0.0'
3) then I run
bundle install
bundle exec rails new .
rails g spree:install
rails s
After installing I've got a conflict with the gem 'spree','1.0.0', so I comment it out.
Also I've got a warning but it works:
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported
Thanks a lot
I think you should use rails version 3.1.3 for spree_usa_epay
TO do that you should uninstall all rails what you have on machine
to watch use
gem list -d rails
than
sudo gem uninstall rails -v ...
and create new project with
rails new my_store
than edit Gemfile and paste
gem 'spree', '1.0.0'
and
bundle install
well done
rails server
Hi i'm a newbie for developing rails application and i have interest
in using 'spree' for my Ecommerce website.
I'm following this tutorial in spree from this site
http://guides.spreecommerce.com/getting_started.html
I made a fresh install as the tutorial above guided me. I made it to the part '5.1 Starting up Spree' using rails 1.9.3 and mysql
database. Everything was fine until i notice the login bar wasn't
appearing like the tutorial did.
I did some research which led me to this solution in
https://github.com/railsdog/deface/issues/12
what i understand from this article, it seems that the problem comes from a 'bug' from the defacement gem when using ruby 1.9.3 ,
but the problem does not appear in 1.9.2 so i changed my ruby
version into 1.9.2 to try it out.
After i installed ruby 1.9.2 i installed 'spree' gem I repeated the project (using mysql database) from the 'getting started
tutorial' to finish the tutorial.
now at part 4.4.2 where i type 'rake db:create' terminal outputs this
store$ rake db:create
store_test already exists
store_development already exists
When i try generate spree site by 'rails g spree:site' , terminal gives me this error
store rails g spree:site
create config/spree.yml /Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/spree_core-0.70.2/lib/generators/spree/site/site_generator.rb:16:in
`block in config_spree_yml': undefined method `version' for
Spree:Module (NoMethodError) from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in
`call' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in
`render' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in
`block (2 levels) in invoke!' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in
`open' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in
`block in invoke!' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:61:in
`invoke!' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions.rb:95:in
`action' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/actions/create_file.rb:26:in
`create_file' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/spree_core-0.70.2/lib/generators/spree/site/site_generator.rb:15:in
`config_spree_yml' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in
`run' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in
`invoke_task' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
`block in invoke_all' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
`each' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
`map' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:124:in
`invoke_all' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/group.rb:226:in
`dispatch' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in
`start' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.2/lib/rails/generators.rb:168:in
`invoke' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.2/lib/strong textrails/commands/generate.rb:12:in `<top (required)>' from
/Usestrong textrs/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in
`require' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in
`block in require' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:223:in
`block in load_dependency' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:640:in
`new_constants_in' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:223:in
`load_dependency' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.2/lib/active_support/dependencies.rb:240:in
`require' from
/Users/macbookpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.2/lib/rails/commands.rb:28:in
`<top (required)>' from script/rails:6:in `require' from
script/rails:6:in `<main>'
I was pretty confuse because i didn't create a database before (but it is showing that it existed). And now i can't even generate
spree site. I researched this problem for days and i haven't found a
matching solution yet. This is what my Gemfile looks like
source 'http://rubygems.org'
gem 'rails', '3.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
# Gems used only for assets and not required
# in production environments by default. group :assets do gem 'sass-rails', '~> 3.1.5.rc.2' gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3' end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do # Pretty printed test output gem 'turn', '0.8.2',
:require => false
gem 'spree' , '0.70.2'
end
I'd really appreciate if someone can give me some pointers or solutions to my problems. I'm quite lost right now, it'll sure make
someone happy. (tell me if u need more information about my ruby
environment)
Have you started with a fresh Rails application? Here's what I did (yesterday) using Ruby 1.9.2p290, Rails 3.1.1 on Fedora 16:
Make sure that ImageMagick in installed - the bootstrap script won't work without it.
Run rails new appname --database mysql
cd appname
Add gem, 'spree', '0.70.3' to Gemfile
Run bundle
Configure database.yml
Run rake db: create - ignore any database exists errors
Run rails generate spree:site - ignore any database exists errors
Run rake db:bootstrap
That should be it.
Just realised - you've got "gem 'spree'..." inside the ":test" group. Not good. Don't muck about with the Gemfile - just add the spree gem at the end.
As of today (December 2nd, 2012) the current version of spree which is compatible with ruby 1.9.3 and rails 3.2.9 is spree -v '1.2.2"
http://spreecommerce.com/blog/2012/11
Version 1.3 is set to release in December 2012
I am no expert, but I think you need to change your gemfile to
gem 'spree', '1.2.2'
Im not going to start by saying i'm a newbie etc. Jokes, been learning Rails for nearly month using Lynda.com. I use Mac, Mac OS X Lion 10.7.
I am trying to intall Paperclip Gem but i can't seem to figure out what i'm doing wrong.
I followed the instructions on https://github.com/thoughtbot/paperclip/wiki/Installation
I added this line to my config/environment.rb
config.gem 'paperclip', :source => 'http://rubygems.org'
and i then tried to run
rake gems:install
I get an error message:
(in /Users/fred/Ruby/food)
rake aborted!
undefined local variable or method `config' for main:Object
/Users/fred/Ruby/food/Rakefile:4:in `require'
(See full trace by running task with --trace)
I then tried the following as an alternative when the above failed
script/plugin install git://github.com/thoughtbot/paperclip
I get the following error
-bash: script/plugin: No such file or directory
My question is how do install this gem? I have read a lot of other posts that say i should include gem 'paperclip', "~> 2.3" is this the same as what i did above?
Best to use bundler. Steps are
Install bundler: gem install bundler
Add to Gemfile: config.gem 'paperclip'
cd to where the Gemfile is and run: bundle install. This will install all the gems mentioned in the Gemfile
Ps. I assume that you are not using rvm. Also, you may need to prefix sudo to the command in step 1 above in case the command does not work for you due to a permission problem.
This question already has answers here:
Undefined method 'task' using Rake 0.9.0
(8 answers)
Closed 6 years ago.
Gemfile only contains rails 3.0.7 and sqlite3, all of a sudden rake will not run on any apps.The error started when running 'rake db:migrate'
Full trace output:
rake aborted!
undefined method `task' for #<NotWorking::Application:0x00000100ccc328>
/Users/codywright/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/Users/codywright/Code/Rails/not_working/Rakefile:7:in `<top (required)>'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180#global/gems/rake-0.9.0/bin/rake:31:in `<top (required)>'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/Users/codywright/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
I did: sudo gem uninstall rake -v 0.9 then added gem 'rake', '0.8.7' to my gem file.
Rather than downgraded your Rake, you can fix your application.rb file by adding the line:
include Rake::DSL
Just add that within the class Application and you should be good!
Example application.rb:
module AppName
class Application < Rails::Application
include Rake::DSL
end
end
gem 'rake', '0.8.7' in Gemfile works, if may also need to run bundle update rake if bundler complains about rake locked '0.9.0'.
Here is the issue on rake github page https://github.com/jimweirich/rake/issues/33
I am on jruby. Here are the exact commands that got me rid of the problem.
jruby -S gem uninstall rake
jruby -S gem install rake -v 0.8.7
edit Gemfile: Add this after gem 'rails':
gem 'rake', '0.8.7'
finally run:
jruby -S bundle update rake
Run these 2 lines at the command prompt. It will remove rake 0.9.0.
substitute your username where it shows "username"
GEM_HOME='/Users/username/.rvm/gems/ruby-1.9.2-p180#global' GEM_PATH='/Users/username/.rvm/gems/ruby-1.9.2-p180#global' gem uninstall rake
GEM_HOME='/Users/username/.rvm/gems/ruby-1.9.2-p180' GEM_PATH='/Users/username/.rvm/gems/ruby-1.9.2-p180' gem uninstall rake
Then install the correct gems:
rvm gem install mysql2 -v 0.2.7
rvm gem install rake -v 0.8.7
Update the MySQL gem (statment here show for x86_64 intel install):
env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
When you create a new app:
rails new -d mysql
you shouldn't need to change the gemfile or use bundle exec
I hope this makes sense. This post wont let me layout the syntax where it is readable.