Pranay-Tares-MacBook-Pro:music_library pranaytare$ rake db:migrate
(in /Users/pranaytare/Sites/music_library)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
(See full trace by running task with --trace)
I got this error while running rake in ROR.. plz help..
I recently installed mysql on my Mac and configured it.
Either install the gem as the error message says, or put the mysql gem in your Gemfile and run bundle install. In the Gemfile, it would be like :
gem 'mysql2'
Related
I am in process of installing Redmine app via RedmineInstall documentation I try step 5 :
bundle exec rake db:migrate
then error shows :
bundler: command not found: rake
Install missing gem executables with ´bundle install´
I use redmine 3.3.0 64 for windows
I use redmine gemfile and rake was installed (i see Using rake 11.2.2)
I tried reinstall it via bundle install or gem install/uninstall, but did not help (see Successfully installed rake-11.2.2 but rake do not work).
I tried this command from ruby/bin directory or redmine directory not success.
I do not understand, that rake is successfully installed, but when i try use it with bundle it says that command not found.
The problem may be in the directory where the Redmine or rake?
Try rake db:migrate in your redmine directory without bundle exec and see if that resolves your issue.
Bundler usually provides bin stubs for rake and other gem files, so that bundle exec is not necessary or will even fail because it will look in an other gem directory where, in this case, rake might not be installed.
I am trying to do "rake db:migrate" and it is giving me this error.
Andy:AcademyAir Andy$ rake db:migrate
/Users/Andy/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.2.2/lib/bundler/runtime.rb:197: warning: Insecure world writable dir /usr in PATH, mode 040777
rake aborted!
You have already activated rake 10.0.2, but your Gemfile requires rake 0.9.2.2. Using bundle exec may solve this.
/Users/Andy/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.2.2/lib/bundler/runtime.rb:31:in `block in setup'
/Users/Andy/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.2.2/lib/bundler/runtime.rb:17:in `setup'
/Users/Andy/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.2.2/lib/bundler.rb:116:in `setup'
/Users/Andy/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.2.2/lib/bundler/setup.rb:7:in `<top (required)>'
/Users/Andy/Desktop/AcademyAir/config/boot.rb:6:in `<top (required)>'
/Users/Andy/Desktop/AcademyAir/config/application.rb:1:in `<top (required)>'
/Users/Andy/Desktop/AcademyAir/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
Try this bundle exec rake db:migrate
Remove rake 10.0.2 gem
By using gem uninstall rake and remove 10.0.2 version of rake gem
And Then Try rake db:migrate
Why Error comes : In you gem list two version (10.0.2 and 0.9.2.2) of rake gem install so that this error comes.*
Another Solution is you can do bundle update
For me, I just ran bundle update and everything works right again.
I was able to solve this by opening up Gemfile and changing gem 'rake', '~> 0.9.2.2' to gem 'rake', '~> 10.0.1'
In your Gemfile, explicitly set the latest rake version by:
gem 'rake', '~> 10.0.1'
And then run
$ bundle update rake
Then try
I've just ran into the same problem.
I inserted in my gemfilen gem 'rake', '~> 10.0.1' [in your case it should be '10.0.2']
I deleted my gemfile lock
I ran rake db:migration again and it worked.
I got this tip here: Activated Ruby RAKE 10.0.1, require 10.0.0
Update: In my case I didn't have rake duplicated. I just have in my gems the 10.0.1 version.
Solved the same issue by running:
bundle update
This will update your rake gem to the latest version and allow you to run the migration.
If you are using a gemset: be sure to run bundle install after you've updated rake to update your local gemset as well.
It happens because you are using rake from the system. (latest version by default)
The solution is use follow command:
bundle exec rake db:migrate
Also, you can create alias. Because this command is too big and difficult to write.
echo "alias be='bundle exec'" >> ~/.bash_profile
source ~/.bash_profile
Then you can use follow short command:
be rake db:migrate
change the version which located both in the gemfile and gemlock to the version number shown in the console, it will be done
im having this issue when i try to deploy my ruby on rails application to heroku, i check different posts here, because i saw this issue before but i couldnt fix it.
when i try to run:
$ heroku rake db:migrate
I get a lot of these ones: DEPRECATION WARNING:
and then:
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.)
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
I tried to change my Gemfile with 'pg' and my group :assets do to :production, i know im missing something but i could'nt figured out what.
Some ideas?
Also when I go to the app url, I get this:
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
Thanks in advance for any suggest and help!!!
You have to use Postgres on Heroku, you can't use sqlite3 because Heroku prohibits you from saving to the file system. So add the pg gem to your production bundle and re-deploy then your migrations should run.
Answer here is simple, add the following production in your gemfile as:
group :production do
gem 'pg'
end
Your local machine won't work with this production, so we now have to bundle it by ignoring PostgreSQL gem which can be done as:
bundle install --without production
After this, try heroku rake db:migrate. Must work.
Good luck
Deploying a Rails3 app, and am having some issues getting rake to find the gems installed by 'bundle install --deployment':
$ rake db:migrate
(in /home/jrdev/rails/testapp)
rake aborted!
!!! Missing the mysql2 gem. Add it to your Gemfile: gem ‘mysql2’
But, that gem in is the Gemfile, and is also in the vendor/bundle folder…
$ bundle show mysql2
/home/jrdev/rails/testapp/vendor/bundle/ruby/1.8/gems/mysql2-0.2.6
My .gemrc file:
gemhome: /home/jrdev/.gems
gempath:
- /home/jrdev/.gems
- /usr/lib/ruby/gems/1.8
I thought rails3 apps already had the bundler code to detect which gems to use? I know I'm using the right rake, too (rake db:migrate --trace starts in /home/jrdev/rails/testapp/vendor/bundle/ruby/1.8/bin/rake). Same result using bundler's exec.
:(
Wouldn't you freaking know I solve it a minute after asking.
My database.yml file was still calling the 'mysql' adapter instead of 'mysql2'.
Still, what an OBSCURE error message!
In /home/jrdev/rails/testapp, you should find a file called Gemfile. Look into it and just add the line
gem 'mysql2'
somewhere.
I am getting the following error when trying to install gems:
Mohammad-Azams-MacBook-Pro:awesomecats azamsharp$ sudo rake gems:install
Password:
(in /Projects/awesomecats)
rake aborted!
Don't know how to build task 'gems:install'
(See full trace by running task with --trace)
Mohammad-Azams-MacBook-Pro:awesomecats azamsharp$
If the task isn't listed in the output of rake -T then it isn't defined and you can't run it.
Rails 3 removed this task in favor of using Gemfile and bundler as the official gem installation procedure as gems:install was often tricky to get working properly.