ruby-debug-ide command exploading in my face - ruby-on-rails

So I'm working on getting some sweet sweet remote debugging action on an old app and found some instructions via https://github.com/ruby-debug/ruby-debug-ide to get my rubymine going. Installing these two gems in my Gemfile...
gem 'ruby-debug-base19x', '~> 0.11.32'
gem 'ruby-debug-ide'
gems installed fine
BUT when I load up the rdebug command i get this error...
$ rdebug
/home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require': /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError)
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `<top (required)>'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in `<top (required)>'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/bin/rdebug:108:in `require_relative'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug19-0.11.6/bin/rdebug:108:in `<top (required)>'
from /home/fonso/.rbenv/versions/1.9.3-p551/bin/rdebug:23:in `load'
from /home/fonso/.rbenv/versions/1.9.3-p551/bin/rdebug:23:in `<main>'
even the full rdebug-ide command exploads in my face
$ rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- rails s
/home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require': /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError)
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `<top (required)>'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide.rb:6:in `<top (required)>'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.2/bin/rdebug-ide:8:in `require_relative'
from /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.7.2/bin/rdebug-ide:8:in `<top (required)>'
from /home/fonso/.rbenv/versions/1.9.3-p551/bin/rdebug-ide:23:in `load'
from /home/fonso/.rbenv/versions/1.9.3-p551/bin/rdebug-ide:23:in `<main>'
Any ideas on how to solve this mystery?

Ok so using gem list and passing grep debug I found I had some odd gems in my box
$ gem list | grep debug
debug_inspector (0.0.3)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.8)
ruby-debug-base19 (0.11.25)
ruby-debug-base19x (0.11.32)
ruby-debug-ide (0.7.2)
ruby-debug19 (0.11.6)
Note the two ruby-debug-base19 thingies? yeah, I suspected that might be a problem along with a few others. So doing some gem uninstall I end up with...
$ gem list | grep debug
debug_inspector (0.0.3)
debugger-ruby_core_source (1.3.8)
ruby-debug-base19x (0.11.32)
ruby-debug-ide (0.7.2)
Now when I run my debug command for rubymine it works
rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- rails s
Fast Debugger (ruby-debug-ide 0.7.2, ruby-debug-base19x 0.11.32, file filtering is not supported) listens on 0.0.0.0:1234
Woo Hoo!

Related

Could not railties in mac os

I had recently followed multiple blogs to completely wipe out rvm, rails and then reinstalled ruby 2.3.0 and rails 5. Made and app using it no issues. But the moment I opened a new terminal window in my machine it was not recognising rails at all as if it was only installed in that particular terminal.
So I just completed my work in that single terminal. Now when I restarted my laptop, I am unable to run the same app. I do not wish to reinstall everything again as I am sure this is a small configuration problem. Why is this happening?
The error message that I am getting now:
/Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'railties' (>= 0.a) among 30 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/sahil/.rvm/gems/ruby-2.3.1:/Users/sahil/.rvm/gems/ruby-2.3.1#global', execute `gem env` for more information
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /Users/sahil/.rbenv/versions/2.3.1/bin/rails:22:in `<main>'
I have already seen other similar questions where they ask to reinstall everything again which I do not want to do as it worked after installing but did not work on system restart.
Now I did gem install rails in one terminal and the app is working again, but if I try to open a new terminal and give the same command rails s, it gives me this error,
Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2
Ignoring nokogiri-1.6.8 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.8
Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2
/Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/io-console-0.4.6/lib/io/console.bundle (fatal)
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/user_interaction.rb:9:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/config_file.rb:8:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:4:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/bundler-1.12.5/lib/bundler/shared_helpers.rb:6:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/bundler-1.12.5/lib/bundler/setup.rb:2:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Users/sahil/Documents/work/Development/todoApp/config/boot.rb:3:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
You mentioned that you reinstalled ruby 2.3.0 and Rails 5. However it seems rbenv is trying to load your project with ruby 2.3.1.
You should switch to ruby 2.3.0. I guess you should be able to do: rbenv local 2.3.0.
To avoid this from happening again though, you should add a .ruby-version dotfile to your project root and in the file only add 2.3.0.
Hope that works

Error while running bundle in rails 4.2.4

I tried running bundle over rbenv but I got this error:
/home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require': cannot load such file -- bundler (LoadError)
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/app_base.rb:319:in `bundle_command'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/app_base.rb:335:in `run_bundle'
from (eval):1:in `run_bundle'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/plugin.rb:23:in `<top (required)>'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/cli.rb:12:in `<top (required)>'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/bin/rails:9:in `<top (required)>'
from /home/armyalone/.rbenv/versions/2.2.3/bin/rails:23:in `load'
from /home/armyalone/.rbenv/versions/2.2.3/bin/rails:23:in `<main>'
Then I tried these commands:
$ gem -v
2.5.0
$ rails -v
Rails 4.2.4
$ bundle -v
Bundler version 1.10.6
$ rbenv -v
rbenv 0.4.0-205-g5fb9c84
Why can't I run bundler?
Run the below command in your terminal
gem install rb-readline
Hope it helps!
I changed the source from https://rubygems.org to http://rubygems.org and ran:
gem update --system
bundle install
now it's working.

Ruby on Rails - Install execjs on Debian

I'm trying to install ruby on rails on debian... I installed everything.
I installed execjs, therubyracer and node.js, too.
Everytime i wanna create a new controller it says:
/usr/local/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /usr/local/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs.rb:5:in `<module:ExecJS>'
from /usr/local/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:3:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/uglifier-2.2.1/lib/uglifier.rb:3:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/adattilo/test/testt/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I made a reboot after the installation of execjs, therubyracer and node.js...
For platforms for which there is binary version of therubyracer gem available, there are no dependencies other than ruby and rubygems. If there is not a binary version for your system, then you will need to compile it from source. To do this, you must have v8 > 3.11.8 installed somewhere on your system.
Try adding following to your Gemfile
gem 'therubyracer', '0.11.0beta5'
gem 'libv8', '~> 3.11.8'
Now, cd to your project and bundle install
$ cd <project>
$ bundle install

rails console error readline load error

I'm having problem with the rails console. It gives me this error when I try installing the readline module using:
yum install readline-devel
I'm working with Rails 3.1.1 on a fedora 14 machine.
/home/led/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (LoadError)
from /home/led/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:3:in `require'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:37:in `require'
from /home/led/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:37:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ADDITION:
i tried installing readline via rvm following this link
[readline install via rvm][1]
and rails c worked but the problem is when reboot my system and tried again it appears to show this error
/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find rack (~> 1.2.1) amongst [ParseTree-3.0.5, RubyInline-3.8.4, ZenTest-4.3.3, abstract-1.0.0, actionmailer-3.0.5, actionpack-3.0.5, activemodel-3.0.5, activerecord-3.0.5, activeresource-3.0.5, activesupport-3.0.5, arel-2.0.9, builder-2.1.2, bundler-1.0.10, cgi_multipart_eof_fix-2.5.0, daemons-1.0.10, diff-lcs-1.1.2, erubis-2.6.6, fastthread-1.0.7, gem_plugin-0.2.3, git-1.2.5, i18n-0.6.0, i18n-0.5.0, json-1.4.6, mail-2.3.0, mime-types-1.17.2, mime-types-1.16, mongrel-1.1.5, mongrel_cluster-1.0.5, multimap-1.1.2, mysql-2.8.1, mysql2-0.3.7, polyglot-0.3.2, polyglot-0.3.1, rack-1.3.5, rack-1.1.0, rack-mount-0.8.3, rack-mount-0.6.13, rack-test-0.6.1, rack-test-0.5.4, rails-3.0.5, railties-3.0.5, rake-0.9.2.2, rake-0.9.2, regin-0.3.8, regin-0.3.7, rspec-core-2.6.4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, ruby2ruby-1.2.4, ruby_parser-2.0.4, sexp_processor-3.0.4, sqlite3-1.3.3, text-format-1.0.0, thor-0.14.6, treetop-1.4.10, treetop-1.4.9, tzinfo-0.3.30, tzinfo-0.3.26] (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:761:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:742:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:764:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:758:in `activate_dependencies'
from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:742:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1211:in `gem'
from /usr/bin/rails:18
You need to install readline headers and libraries prior installing the Ruby interpreter (it is shown once you complete the installation of RVM)
You can see that again doing rvm notes
Check that the readline gem is installed. The above yum command installs the readline library, but to interact with it, you need the gem.
If it's not in your Gemfile, add it, run bundle install and check again.

Bundle command the wrong mysql2 gem (always 0.3.2)

I got an error when trying to run $rails console
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2.rb:8
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
from /Users/ccool2486/Sites/test3mysql/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:21:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:21
from script/rails:6:in `require'
from script/rails:6
ccool-2:test3mysql ccool2486$ rails console
WARNING: This version of mysql2 (0.3.2) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter) (RuntimeError)
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/railtie.rb:59
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/base.rb:1903
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/railtie.rb:32
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `call'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `to_proc'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/railtie.rb:180:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/railtie.rb:180:in `load_console'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application.rb:154:in `load_console'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application/railties.rb:11:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application/railties.rb:11:in `all'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application.rb:154:in `load_console'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands/console.rb:26:in `start'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands/console.rb:8:in `start'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:23
from script/rails:6:in `require'
from script/rails:6
Hmm... so i tried to uninstall the mysql2 gem, and reinstall the version 0.2.7 gem
sudo gem uninstall mysql2 -i /Library/Ruby/Gems/1.8
And I changed the gemfile:
gem 'mysql2','0.2.7'
Ran Bundler in my app directory:
bundle install
But it installed the version 0.3.2 back again!!! Can anyone help, I honestly don't know what happened here.
sudo gem uninstall mysql2
in Gemfile gem 'mysql2', '< 0.3'
bundle update
with your
gem 'mysql2','0.2.7'
Try
bundle update
it builds the bundle from scratch

Resources