Nokogiri won't let me bundle install in Rails

徘徊边缘 提交于 2019-12-12 09:33:15

问题


I've seen this question asked and tried everything I've seen suggested.

I got a new macbook and am looking to set up an existing app. When i clone the app, it will not bundle install and acts like Rails is not installed, even though it works in other directories.

I tried removing version numbers from gemfile and deleting gemfile.lock. I tried bundle update. I'm on osx 10.9.4, rails 4.1.5 and ruby 2.1.1.

the error I am getting:

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

I have rvm installed. I tried reinstalling homebrew, rails and ruby.

What could it be?


回答1:


Ok, phew. This worked:

http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/

xcode-select --install
gem install nokogiri
bundle config build.nokogiri --use-system-libraries
bundle install

then, the pg gem wouldnt let bundle install. this fixed it - Installing PG gem on OS X - failure to build native extension

brew update
brew install postgresql
gem install pg

then... bundle install worked, finally, but rails s was giving me an error, which this fixed: Devise Secret Key was not set

just had to add the line w/the secret key to the config/initializers/devise.rb right before the last 'end'

hope this helps anyone who upgrades to Mavericks / gets a new computer that comes with it installed!




回答2:


First try to do this sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev, then try to install



来源:https://stackoverflow.com/questions/25438708/nokogiri-wont-let-me-bundle-install-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!