ruby & gems

gem install extension_name -v version

gem uninstall extension_name -v version

I met a problem when I install the mysql

it’s caused by the mysql extension search /usr/local for mysql develop files

ln -s /usr/include/mysql /usr/local/include/

ln -s /usr/lib/mysql /usr/local/lib/

when I started the app that created with ruby

it show the warning:

boot.rb:20:Warning: Gem::SourceIndex#search support for String patterns is deprecated

we can change the boot.rb on line 20

rails_gem = Gem.cache.search(‘rails’, “=#{rails_gem_version}.0”).sort_by { g g.version.version }.last

“Gem.cache.search”, just replace “search” with “find_name”.

or changed into

rails_gem = Gem.cache.search(Gem::Dependency.new(‘rails’,“~>#{version}.0”)).sort_by { g g.version.version }.last