PENGZhaoqing / CourseSelect

校园选课系统样本 (a template for course selection system by Ruby on Rails)
https://courseselect.herokuapp.com/
MIT License
105 stars 205 forks source link

gem install nokogiri -v '1.6.8' #81

Closed qingdujun closed 7 years ago

qingdujun commented 7 years ago

执行bundle install时报错。

qingdujun@thinkpad:~/pro/CourseSelect$ bundle install

//...
`Gem::Ext::BuildError: ERROR: Failed to build gem native extension.`
//...
An error occurred while installing nokogiri (1.6.8), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.8'` succeeds before bundling.

qingdujun@thinkpad:~/pro/CourseSelect$ sudo gem install nokogiri -v '1.6.8'

Building native extensions.  This could take a while...
//...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

我可以删除Gemfile.lock吗?

解决方案:

sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
gem install nokogiri

now, everything is ok!

but, another question.....

An error occurred while installing pg (0.18.4), and Bundler cannot continue. Make sure that gem install pg -v '0.18.4' succeeds before bundling.

解决方案:

sudo apt-get install libpq-dev
sudo gem install pg
PENGZhaoqing commented 7 years ago

Gemfile.lock是rails自己管理的,你不用管他