ubuntu安装rails 出现错误

安装mysql:

按顺序执行 肯定不出错
1: sudo apt-get install mysql-server mysql-client libmysqlclient15-dev
2: sudo gem install mysql

 

这段时间把centos换成ubuntu后,环境重装,在装rails时出现了以下错误:

请注意如果使用RVM安装的Ruby,安装文件在Src文件中,而不是在Rubies文件中。

afeicool@localhost:~$ gem install rails
ERROR:  Loading command: install (LoadError)
no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand

解决方案:

apt-get install zlib-bin zlib1g-dev
cd path/to/your ruby source dir/ext/zlib
ruby extconf.rb –with-zlib-include=/usr/include –with-zlib-lib=/usr/lib
make
make install

你可能感兴趣的:(ubuntu)