when I run E:\dvv\www\yii2progect>vagrant up
I see error
C:/HashiCorp/Vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/bin/vagrant:47:in `[]=': Invalid argument - ruby_setenv(VAGRANT_NO_PLUGINS) (Errno::EINVAL)
from C:/HashiCorp/Vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/bin/vagrant:47:in `block in <main>'
from C:/HashiCorp/Vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/bin/vagrant:36:in `each_index'
from C:/HashiCorp/Vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/bin/vagrant:36:in `<main>'
I did it
I need install additional plugins
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-cachier
Related
Installed Rails 3.2.3 and MySQL 5.6 fine on my OSX 10.7.3
I created a new project called "simple_cms" and then, in the terminal, tried to launch webrick with "rails server" and got nothing.
Hideyoshis-MacBook-Pro:simple_CMS gregpfeffer$ rails s
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:inrequire'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119:in require'
from /Users/gregpfeffer/Sites/simple_cms/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53:inrequire'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:53
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50:in tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.3/lib/rails/commands.rb:50
from script/rails:6:inrequire'
from script/rails:6
Hideyoshis-MacBook-Pro:simple_CMS gregpfeffer$ sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/lib/mysql2/mysql2.bundle
install_name_tool: can't open file: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.4/lib/mysql2/mysql2.bundle (No such file or directory)
try adding:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_LIBRARY_PATH
To your .bash_profile
this assumes you accepted the default installation location for mysql
I'm trying to install the mysql gem v. 2.7 on MacOsX Snow Leopard.
I know a lot has been written about this, and I've read most of it.
If I do the following:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -v '2.7' -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
I get:
ERROR: While executing gem ... (TypeError)
can't dup NilClass
Instead, trying to install v 2.8 works fine:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1...
Installing RDoc documentation for mysql-2.8.1...
But then I get this error when trying to start my local server:
=> Booting WEBrick
=> Rails 2.3.6 application starting on http://0.0.0.0:3000
/Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant MysqlCompat::MysqlRes (NameError)
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/dependencies.rb:80:in `const_missing'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/mysql_adapter.rb:9:in `define_all_hashes_method!'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/mysql_adapter.rb:68:in `mysql_connection'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activerecord-2.3.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
from /Users/phishman/Sites/BlindDog/vendor/plugins/admin_data/lib/admin_data/settings.rb:65:in `initialize_defaults'
from /Users/phishman/Sites/BlindDog/vendor/plugins/admin_data/init.rb:36:in `evaluate_init_rb'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/rails/plugin.rb:158:in `evaluate_init_rb'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/rails/plugin.rb:154:in `evaluate_init_rb'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/rails/plugin.rb:48:in `load'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/rails/plugin/loader.rb:38:in `load_plugins'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/rails/plugin/loader.rb:37:in `each'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/rails/plugin/loader.rb:37:in `load_plugins'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/initializer.rb:369:in `load_plugins'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/initializer.rb:165:in `process'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/initializer.rb:113:in `send'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/initializer.rb:113:in `run'
from /Users/phishman/Sites/BlindDog/config/environment.rb:9
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/dependencies.rb:156:in `require'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/dependencies.rb:156:in `require'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/activesupport-2.3.6/lib/active_support/dependencies.rb:156:in `require'
from /Users/phishman/Sites/BlindDog/vendor/ruby/1.8/gems/rails-2.3.6/lib/commands/server.rb:84
from script/server:3:in `require'
from script/server:3
Can you help me? Please, I've been breaking my head on this for 2 days :(
MySQL I'm using is the dmg downloaded from mysql.com. I even tried to uninstall it and install mysql from macports but getting lots of errors, so I had to re-install from mysql.com
I just ran into this issue myself. Googling turned up not only this question (which didn't help me - this project isn't ready for Bundler, plus we're using RVM so sudo is out) but also IRC logs from when I asked the same question on the RVM IRC channel a year ago. (Hmm, this sounds familiar.)
If you don't feel like sifting through the IRC log, here's the summary: newer versions of Rubygems (e.g. 1.6.x, which RVM installs by default with ree-1.8.7, which is what we were using) don't play well with the mysql gem. Try this:
ree-1.8.7 $ rvm rubygems 1.5.2
Removing old Rubygems files...
Installing rubygems-1.5.2 for ree-1.8.7-2012.02 ...
Installation of rubygems completed successfully.
ree-1.8.7 $ env ARCHFLAGS="-arch x86_64" gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while...
Successfully installed mysql-2.7
1 gem installed
Installing ri documentation for mysql-2.7...
Installing RDoc documentation for mysql-2.7...
ree-1.8.7 $
Works a treat.
Found the way to install mysql gem and make it work:
I installed rvm, istalled ruby 1.8.7 and made it the defualt ruby (instead of the system one), then I compiled and reinstalled all the gems using
sudo env ARCHFLAGS="-arch x86_64" bundle install
Now it works!
I just ran in to this problem myself; we have an app that's running on an older version of ruby and rails.
I am using:
rbenv
Mac OS - Mavericks
bundler
ruby ree-1.8.7-2010.02
I had to downgrade rubygems:
gem update --system 1.5.2
Then I could install mysql 2.7 (and everything else) with:
sudo env ARCHFLAGS="-arch x86_64" bundle install
I can't seem to get mysql to work with my new rails app at all... terminal copy below:
Janes-MacBook-Pro:development janelee$ cd hellomysql
Janes-MacBook-Pro:hellomysql janelee$ rails server
/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: mach-o, but wrong architecture - /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2.rb:9
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `require'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
from /Users/janelee/Development/hellomysql/config/application.rb:7
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/railties-3.2.1/lib/rails/commands.rb:53
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
from /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/railties-3.2.1/lib/rails/commands.rb:50
from script/rails:6:in `require'
from script/rails:6
Janes-MacBook-Pro:hellomysql janelee$ rake db:migrate
rake aborted!
dlopen(/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): no suitable image found. Did find:
/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: mach-o, but wrong architecture - /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
(See full trace by running task with --trace)
and I tried this too:
Janes-MacBook-Pro:hello janelee$ gem uninstall sqlite3
You have requested to uninstall the gem:
sqlite3-1.3.5
i18n-0.6.0 depends on [sqlite3 (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Successfully uninstalled sqlite3-1.3.5
Janes-MacBook-Pro:hello janelee$ ARCHFLAGS="-arch x86_32" sudo gem install sqlite3
Password:
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.5
1 gem installed
Janes-MacBook-Pro:hello janelee$ rake db:migrate
rake aborted!
dlopen(/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle, 9): no suitable image found. Did find:
/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle: mach-o, but wrong architecture - /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle
(See full trace by running task with --trace)
and this:
Janes-MacBook-Pro:hello janelee$ gem uninstall sqlite3
You have requested to uninstall the gem:
sqlite3-1.3.5
i18n-0.6.0 depends on [sqlite3 (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Successfully uninstalled sqlite3-1.3.5
Janes-MacBook-Pro:hello janelee$ ARCHFLAGS="-arch x86_64" sudo gem install sqlite3
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.5
1 gem installed
Janes-MacBook-Pro:hello janelee$ rake db:migrate
rake aborted!
dlopen(/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle, 9): no suitable image found. Did find:
/Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle: mach-o, but wrong architecture - /Users/janelee/.rvm/gems/ruby-1.8.7-p174/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle
(See full trace by running task with --trace)
What else should I try before reinstall Lion?
Look into using Ruby Version Manager (called rvm) and then update Ruby. Try using ver 1.9 of ruby or higher. Don't reinstall your OS. If anything, remove rails, remove ruby. Install rvm, install ruby 1.9, install rails. If you follow that recipe, all should be well.
Configuring Rails to work with MySQL will happen through changing the file:
myappname/config/database.yml
Good information is here: How do I set MySQL as the default database in Rails 3?
... and here: Create a new Ruby on Rails application using MySQL instead of SQLite
Get used to looking at the Rails guides. Examples like this: http://guides.rubyonrails.org/getting_started.html#configuring-a-database are all you need to get going.
I've installed rails, the mysql2 gem, and mysql and have created a project called simple_cms using rails new simple_cms -d mysql. Now when I execute rails server to start WEBricks, I get this bucket of joy:
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql/lib/libmysqlclient.16.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/tyre77/Dropbox/Broetry In Motion/RailsTestApp/simple_cms/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/commands.rb:53
from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.1/lib/rails/commands.rb:50
from script/rails:6:in `require'
from script/rails:6
I have changed my .bash_profile to look like this: (not sure if relevant)
PS1="\u \w$ "
alias ll="ls -lahG"
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/$PATH"
# include .bashrc if it exists
if [ -f $HOME/.bashrc ]; then
. $HOME/.bashrc
fi
# startup virtualenv-burrito
if [ -f $HOME/.venvburrito/startup.sh ]; then
. $HOME/.venvburrito/startup.sh
fi
See:
Unable to start rails server but my mysql version is different and that doesn't solve it even with changing 0.2.6 to 0.3.11
The issue is that Ruby can't find the libraries necessary to build the MySQL gem, there are many ways to fix this but since it looks like you're just starting up on Ruby, I think it's worth to prepare your environment so you don't see this kind of stuff again, here are the steps:
First I would recommend you to install Homebrew, with Homebrew installed, install MySQL:
brew install mysql
This will install MySQL in your machine including the necessary libraries to build the MySQL gem when you need it.
Then you should to install RVM to install your rubies (before installing RVM you need to run brew install git). Once you install RVM, you can start installing any rubies you would like to.
And then you ask, why can't you use the built in Ruby? Rails will drop support for the Ruby 1.8.* branch on 4.0 and the community in general uses RVM (or rbenv) to install and manage rubies installed to your machine.
I have installed rails and mysql. I have also installed mysql2 gem. I created a rails application by the command
rails new try_cms -d mysql
It was created successfully. But when I try to run the WEBrick server using rails server command I get the following errors.
/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2.rb:7
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler.rb:114:in `require'
from /Users/dilippednekar/Sites/try_cms/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6
Thanks in advance.
Try running this (see similar question here)
sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Just ran into this problem myself. Make sure you update the version numbers.
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
For some reason the mysql2.bundle file was not in my mysql2 gem. I ran
gem uninstall mysql2
and the gem was uninstalled. Then I immediately ran
sudo gem install mysql2
Then
sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Finally rails s launched the server!
I had similar problems. The solutio that worked for me was found here.
If you want something a little less intrusive, just set the DYLD_LIBRARY_PATH environment variable in your MySQL's lib direction.
export DYLD_LIBRARY_PATH=$MYSQL_HOME/lib
I was just hit with this using Rails 3.1.0, ruby-1.9.2-p290 and mysql2 0.3.7. My solution was to downgrade to mysql 2.8.1. Everything looks good so far (I wasn't even able to start the environment).
sudo apt-get install libmysqlclient15-dev libmysqlclient15off libmysql-ruby