I am at the end of Chapter 2 of Hartl's Rails Tutorial the app works locally but I can't get it to deploy.
http://quiet-ocean-3277.herokuapp.com/
$ git push heroku master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 253 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Using rake (10.1.0)
Using i18n (0.6.4)
Using minitest (4.7.5)
Using multi_json (1.7.7)
Using atomic (1.1.10)
Using thread_safe (0.1.0)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using hike (1.2.3)
Using jbuilder (1.0.2)
Using jquery-rails (2.2.1)
Using json (1.8.0)
Using pg (0.15.1)
Using bundler (1.3.2)
Using tilt (1.4.1)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using rails_serve_static_assets (0.0.1)
Using rails_stdout_logging (0.0.1)
Using rails_12factor (0.0.2)
Using rdoc (3.12.2)
Using sass (3.2.9)
Using sass-rails (4.0.0)
Using sdoc (0.3.20)
Using turbolinks (1.1.1)
Using uglifier (2.1.1)
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (7.52s)
Cleaning assets
-----> WARNINGS:
You have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:
ruby '1.9.3'
# See https://devcenter.heroku.com/articles/ruby-versions for more information."
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 20.0MB
-----> Launching... done, v8
http://quiet-ocean-3277.herokuapp.com deployed to Heroku
To git#heroku.com:quiet-ocean-3277.git
2d25f33..322b9e4 master -> master
All looks good except the app crashes. In the logs:
2013-07-17T23:56:21.430674+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-18T00:00:36.148404+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-18T00:00:39.933663+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40617 -e $RAILS_ENV`
2013-07-18T00:00:41.477904+00:00 app[web.1]: /usr/bin/env: ruby1.9.1: No such file or directory
2013-07-18T00:00:42.674144+00:00 heroku[web.1]: Process exited with status 127
Why is it calling Ruby 1.9.1 and crashing ? Here's the gemfile:
source 'https://rubygems.org'
#ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.0'
group :development do
gem 'sqlite3', '1.3.7'
end
gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
I had same problem. I solved it by repacement "#!/usr/bin/env ruby1.9.1" => "#!/usr/bin/env ruby" in 3 files:
bin/bundle
bin/rails
bin/rake
Short answer, you need to specify the ruby version in the Gemfile. It looks like you have it commented out. Heroku uses ruby v1.9.1 by default
This answer links to a gist with steps you can follow to make sure your local and heroku set up are correct.
I would recommend placing:
ruby '2.0.0'
in your Gemfile towards the top. Ruby 2.0.0 contains many changes that increase performance and it works better with Rails 4.
Related
My question regarding to rails crashing post deployment. My deployment works fine. I created a standard rails app with rails new myapp --database=postgresql. Then, I commit my changes and push to heroku. Which tells me:
git push
Fetching repository, done.
Counting objects: 25, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (18/18), 1.94 KiB | 0 bytes/s, done.
Total 18 (delta 14), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Using rake (10.1.0)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.2)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.2)
Using activemodel (4.0.2)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.2)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.2)
Using coffee-rails (4.0.1)
Using hike (1.2.3)
Using jbuilder (1.5.3)
Using jquery-rails (3.0.4)
Using json (1.8.1)
Using pg (0.17.0)
Using bundler (1.3.2)
Using tilt (1.4.1)
Using sprockets (2.10.1)
Using sprockets-rails (2.0.1)
Using rails (4.0.2)
Using rdoc (3.12.2)
Using sass (3.2.12)
Using sass-rails (4.0.1)
Using sdoc (0.3.20)
Using turbolinks (2.0.0)
Using uglifier (2.3.3)
Your bundle is complete! It was installed into ./vendor/bundle
Bundle completed (0.46s)
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (1.92s)
Cleaning assets
-----> WARNINGS:
Include 'rails_12factor' gem to enable all platform features
See https://devcenter.heroku.com/articles/rails-integration-gems for more information.
You have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:
ruby '2.0.0'
# See https://devcenter.heroku.com/articles/ruby-versions for more information.
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby -> console, rake, web, worker
-----> Compressing... done, 21.3MB
-----> Launching... done, v10
http://communityshare-web.herokuapp.com deployed to Heroku
To git#heroku.com:communityshare-web.git
1488048..2268228 master -> master
So it looks like everything went ok, but I get an error page when I visit my heroku app.
After running heroku logs, I see the following:
2013-12-12T21:56:18.114338+00:00 heroku[web.1]: State changed from crashed to starting
2013-12-12T21:56:25.558687+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 6442 -e $RAILS_ENV`
2013-12-12T21:56:26.741673+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:3:in `<top (required)>'
2013-12-12T21:56:26.741673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/inflections.rb:1:in `require': cannot load such file -- thread_safe (LoadError)
2013-12-12T21:56:26.741673+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/inflections.rb:1:in `<top (required)>'
2013-12-12T21:56:26.741673+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:3:in `require'
2013-12-12T21:56:26.741673+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies/autoload.rb:1:in `require'
It looks like you need to add
gem thread_safe
to your GemFile and rerun
bundle
however, if there are other errors running heroku logs --tail for a running log or heroku logs -n 500 for a specific number of lines, should help to get some more detail
I don't use rails but I had a similar problem with node on heroku - I forgot to save a dependency to my package.json file and heroku didn't know to download it. Seems like you're having that same issue with your active support gem.
FYI, did you add your ruby version to your Gemfile?
Something like this..
--------- Gemfile ---------------------------------
source 'https://rubygems.org'
ruby "2.0.0"
gem list ....
make sure you bundle once more, hope that help..
I'm trying out Heroku as a host for our current Rails 4.0.0 project. Although this seems to be a regular issue for Heroku users, none of the solutions that I have found have made any difference for me.
The server is not serving up any of our images, css, or js from our assets.
I've tried adding gems:
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
gem 'rails_12factor'
and setting the config options in production.rb to:
config.action_dispatch.x_sendfile_header = "X-Accel-Redirect"
config.serve_static_assets = true
config.assets.initialize_on_precompile = false
in various combinations but the server still will not load any of the assets.
To be clear, and in case I've missed anything simple, I'm making these changes, committing the code to GitHub, then executing git push staging master. My development machine is a Windows 8 machine.
EDIT
Here is the output from executing git push staging master:
Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 569 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle -
-binstubs vendor/bundle/bin
Updating git://github.com/milgner/compass-rails.git
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using i18n (0.6.4)
Using minitest (4.7.5)
Using multi_json (1.7.7)
Using atomic (1.1.10)
Using thread_safe (0.1.0)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using bundler (1.3.2)
Using chunky_png (1.2.8)
Using coffee-script-source (1.6.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using fssm (0.2.10)
Using sass (3.2.9)
Using compass (0.12.2)
Using compass-rails (1.0.3) from git://github.com/milgner/compass-rails.g
it (at 1749c06)
Using hike (1.2.3)
Using jbuilder (1.4.2)
Using jquery-rails (3.0.4)
Using json (1.8.0)
Using modernizr-rails (2.6.2.3)
Using pg (0.15.1)
Using tilt (1.4.1)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using rails_serve_static_assets (0.0.1)
Using rails_stdout_logging (0.0.1)
Using rails_12factor (0.0.2)
Using rdoc (3.12.2)
Using sass-rails (4.0.0)
Using sdoc (0.3.20)
Using turbolinks (1.3.0)
Using uglifier (2.1.2)
Using zurb-foundation (4.0.9)
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
Removing rails_log_stdout (01b5bcc572e3)
Removing rails3_serve_static_assets (84910ceb4ca2)
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (13.42s)
Cleaning assets
-----> WARNINGS:
Removing `Gemfile.lock` because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 37.0MB
-----> Launching... done, v16
http://myproject.herokuapp.com deployed to Heroku
To git#heroku.com:myproject.git
82f4d58..e930ff1 master -> master
In your production config file, have you also tried setting:
config.assets.compile = true
config.assets.digest = true
The config.assets.initialize_on_precompile line has been removed and is not needed in Rails 4.
Also, the rails_12factor gem is set up to include the two other gems you need for heroku, so you don't have to include them in your Gemfile. You can get more info about that on their github page.
For whatever reason, though, I always had to make sure to use the rails image_tag to get my images to display in production. Not sure if you are doing that, but it made a big difference on my app.
Hope this helps!
I added to my new RoR application - gem twitter bootstrap. I used CSS stylesheets
gem "twitter-bootstrap-rails"
rails generate bootstrap:install static
I changed my GEMFILE
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem "twitter-bootstrap-rails"
end
And when I deployed my app on Heroku, I received this log
Delta compression using up to 4 threads.
Compressing objects: 100% (59/59), done.
Writing objects: 100% (70/70), 26.75 KiB, done.
Total 70 (delta 4), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.3)
Installing i18n (0.6.1)
Installing multi_json (1.5.0)
Installing activesupport (3.2.9.rc2)
Installing builder (3.0.4)
Installing activemodel (3.2.9.rc2)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.3)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.8.2)
Installing actionpack (3.2.9.rc2)
Installing mime-types (1.19)
Installing polyglot (0.3.3)
Installing treetop (1.4.12)
Installing mail (2.4.4)
Installing actionmailer (3.2.9.rc2)
Installing arel (3.0.2)
Installing tzinfo (0.3.35)
Installing activerecord (3.2.9.rc2)
Installing activeresource (3.2.9.rc2)
Installing coffee-script-source (1.4.0)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.7.6)
Installing rdoc (3.12)
Installing thor (0.16.0)
Installing railties (3.2.9.rc2)
Installing coffee-rails (3.2.2)
Installing commonjs (0.2.6)
Installing jquery-rails (2.1.4)
Installing less (2.2.2)
Installing less-rails (2.2.6)
Installing libv8 (3.11.8.13)
Using bundler (1.3.0.pre.5)
Installing rails (3.2.9.rc2)
Installing ref (1.0.2)
Installing sass (3.2.5)
Installing sass-rails (3.2.5)
Installing therubyracer (0.11.2)
Installing twitter-bootstrap-rails (2.2.0)
Installing uglifier (1.3.0)
Your bundle is complete! It was installed into ./vendor/bundle
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Post-install message from twitter-bootstrap-rails:
Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS.
**********************************************
ExecJS supports these runtimes:
therubyracer - Google V8 embedded within Ruby
therubyrhino - Mozilla Rhino embedded within JRuby
Node.js
Apple JavaScriptCore - Included with Mac OS X
Microsoft Windows Script Host (JScript)
**********************************************
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (25.98s)
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 15.9MB
-----> Launching... done, v6
http://rocky-badlands-2634.herokuapp.com deployed to Heroku
When I start my app, I receive message - "We're sorry, but something went wrong."
I think maybe it's connected with this message in log
Post-install message from twitter-bootstrap-rails:
Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS.
If I use the Less stylesheets I also receive this message
Rails uses SASS instead of LESS. You will have to install the less-rails gem to have LESS support.
Following the twitter-bootstrap-rails instructions you will end up with:
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
installed out of the assets group. This might solve your problem.
Just add this to the Gemfile
gem 'twitter-bootstrap-rails', '2.1.3'
and then do
bundle install
and then push to heroku
Just started up in Rails. I'm on windows vista, installed the latest build of ruby from http://rubyinstaller.org/ and everything went well.
ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
I run:
gem update --system
gem sources -a http://gemcutter.org
gem install rails
No errors reported.
rails --v
Rails 3.1.0
after this I created a folder for my Rails project and I created a new Rails app inside as follows:
rails new test
cd test
bundle install
(again no error reported)
But when I run rails server I get this error:
rails server
←[31mCould not find rails-3.1.0 in any of the sources←[
←[33mRun `bundle install` to install missing gems.←[0m
I try to run bundle again but no success again... After this, if I type again rails -v I get the same error as before. I have to close the windows console and reopen for rails -v to start working again!!
Has anyone experience this?! Can you help?
Thanks!!!
As requested the gemfile content is:
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
# 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', :require => false
end
bundle install result:
Fetching source index for http://rubygems.org/
Using rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.0)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.2)
Using rack-cache (1.0.3)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.0)
Using actionpack (3.1.0)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.0)
Using arel (2.2.1)
Using tzinfo (0.3.29)
Using activerecord (3.1.0)
Using activeresource (3.1.0)
Using ansi (1.3.0)
Using bundler (1.0.18)
Using coffee-script-source (1.1.2)
Using execjs (1.2.4)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.1.0)
Using coffee-rails (3.1.0)
Using jquery-rails (1.0.13)
Installing rails (3.1.0)
Using sass (3.1.7)
Using sass-rails (3.1.0)
Using sqlite3 (1.3.4)
Using turn (0.8.2)
Using uglifier (1.0.2)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.
try bundle exec rails server instead of rails server
Ok i keep getting this error
Could not find tzinfo-0.3.24 in any of the sources (Bundler::GemNotFound)
I am using rvm and i just created a gemset and i have this
gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.7)
bcrypt-ruby (2.1.4)
builder (2.1.2)
bundler (1.0.7)
devise (1.1.5)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.14)
mime-types (1.16)
mysql (2.8.1)
paperclip (2.3.8)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
riddle (1.2.2)
thinking-sphinx (2.0.0)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.24)
warden (1.0.3)
will_paginate (3.0.pre2)
and my Gemfile is
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'mysql'
gem 'devise'
gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'
gem "paperclip", "~> 2.3"
gem "will_paginate", "~> 3.0.pre2"
any ideas...it was working fine till today
Try including tzinfo-0.3.24 in your Gemfile and doing bundle exec with the command that gives you the error. Alternatively you could bundle install --development to get the Gems in the vendor folder. Let us know how you get on.
After DLL Hell we have Gem Hell. It looks like we have the same dependency hell in Ruby as in other communities. Welcome :-)
The gem tzinfo with the right version 0.3.24 seems to be missing, or it is not referenced correctly in your Gemfile. Check your Gemfile and your Gemfile.lock. The latter is useful to find out dependencies, and it should be updated if the Gemfile is changed (by running a bundle install).
If you have installed the gems locally, by using gem install --user-install gemname or bundle install --path ~/.gem, then you maybe have multiple gems in multiple locations. Check out the GEM PATHS by calling a gem env command from the command line.
And by the way, you seem to use Rails 3.0.x with the old mysql gem. The mysql2 gem is now the default in Rails 3. I would recommend to use the mysql2 gem instead by adding gem 'mysql2' to the GemFile and by using using the mysql2 adapter in your database.yml.