Ruby on Rails: I would like to call a controller on the localhost, but the server said !!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'
The problem ? When I hit 'gem list' command then I got a list witch is containing the mysql 2.8.1 . So the gem is INSTALLED ! WHY can't it see by the webrick ?
Thank you.
You need to add the line gem 'mysql', '2.8.1'
to your Gemfile. Then type bundle install
in the root folder of your Rails project. It sounds like you forgot to run bundler.
The MySQL gem does require native C extensions. So you'll need to make sure that you have all the development libraries installed.
In Ubuntu you can do something like this:
sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby libmysqlclient-dev
sudo gem install mysql
If you are using rvm, do not install gems as sudo.
Just to make sure, you might also want to try removing your Gemfile.lock and then re-running bundle install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With