Ruby on Rails - Install execjs on Debian - ruby-on-rails

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

Related

Ruby on Rails - Postgres error when trying to start Rails Server

I am using:
ruby 2.2.1
rails 4.6.2
homebrew for postgres installation
rbenv
osx el capitan 10.11.5
Here is the error I receive when running:
rails s
/usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg.rb:4:in `require': dlopen(/usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg_ext.bundle, 9): Library not loaded: /usr/local/lib/libruby.2.2.0.dylib (LoadError)
Referenced from: /usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg_ext.bundle
Reason: image not found - /usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg_ext.bundle
from /usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/bin/rails:9:in `require'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/bin/rails:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in `load'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client/command.rb:7:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client.rb:30:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/bin/spring:49:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in `load'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I ended up starting over with the entire rbenv, ruby and rails installation.
brew update
brew uninstall --force ruby
brew uninstall --force openssl
brew install openssl
brew link openssl --force
brew uninstall --force ruby-build
Then I followed this guide and it worked:
https://gorails.com/setup/osx/10.11-el-capitan
Except for the libxml2 error while installing rails:
libxml2 is missing. Please locate mkmf.log to investigate how it is failing.
I fixed that by running
$ gem install nokogiri -- --use-system-libraries [--with-xml2-config=/path/to/xml2-config] [--with-xslt-config=/path/to/xslt-config]

rails console require cannot load such file readline

I am new to Ruby on Rails, and I install ruby by source.
Ruby version is 2.3.0 and rails version is Rails 4.2.5.
I can't run rails c or rails console.
It giving me the following error:
Running via Spring preloader in process 4267
/usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- readline (LoadError)
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/2.3.0/irb/completion.rb:10:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/console.rb:3:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:58:in `console'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
from /home/james/Desktop/myapp/bin/rails:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `block in load'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in `load'
from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
EDIT
I try second solution in #Vasfed link, and it give me following error:
make: *** No rule to make target `/internal.h', needed by `readline.o'. Stop.
Readline gem is required by your application but not specified in your Gemfile
Please add this to your gem file
gem 'rb-readline'
Also reinstall
libreadline-dev
If you installed from source, install libredline-dev first and then go to ruby-2.3.0/ext/readline (or wherever the source code is)/ext/readline.
ruby extconf.rb
make
make install
if you get an error, edit Makefile after runing extconf.rb and add top_srcdir = ../.. after archdir = $(rubyarchdir).
Then, run make && make install again.
You need some extra dependencies
sudo apt-get install build-essential libssl-dev curl libcurl3 libreadline-dev libcurl4-openssl-dev libffi-dev libgdbm3 libgdbm-dev
After installing dependences, do this in ruby source code folder:
.configure
make
sudo make install
The accepted answer (installing the gem rb-readline) is a workaround.
Don't do that, instead, your ruby should be installed with ext/readline.
For that you need ncurses devel and readline devel libraries
In CentOS that is
yum install readline readline-devel ncurses ncurses-devel
For Ubuntu, read Abel's anwer.
Oh, and after installing the libraries, you should recompile your ruby.

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.

rails server not starting

I just bundle installed successfully and now I get this error when I start the rails server.
I have already tried to start the server by installing openssl and re-installing rvm.
I'm using rvm 1.8.7 and rails 3.0.10.
rony#linuxmint ~/Documents/trunk $ rails s
/home/rony/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require': no such file to load -- openssl (LoadError)
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:593:in `new_constants_in'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/stripe-1.7.0/lib/stripe.rb:7
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370#global/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /home/rony/Documents/trunk/config/application.rb:8
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.0.10/lib/rails/commands.rb:28:in `require'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.0.10/lib/rails/commands.rb:28
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.0.10/lib/rails/commands.rb:27:in `tap'
from /home/rony/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.0.10/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6
Ref this
rvm pkg install openssl (older format - rvm package install openssl)
rvm pkg install iconv (older format - rvm package install iconv)
rvm remove 1.9.2
rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr
Credit to http://www.isnull.com.ar/

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