Ruby on Rails gem problem
I'm using Ruby on rails (RubyMine) and I try starting my project. Which tells me the error "Could not find gem 'mysql2 (~> 0.2.6, runtime)' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)".
I've done sudo gem install mysql which gives me
"Error installing mysql: ERROR: Failed to build gem native extension. Gem files will remain installed in /var/lib/gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /va开发者_JAVA技巧r/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out "
What should I do?
You're probably missing the development headers for MySQL. Often this is shipped as an optional package to install. You may need to install mysql-dev
or mysql-devel
depending on your package manager.
You might also be missing a compiler, so check that you have the required dependencies for gem
such as make
and gcc
.
You might be missing the Ruby development headers as well. On my Ubuntu 11.04 box I have the following aptitude package which is needed for native gem compilation:
ruby1.9.1-dev
精彩评论