简体   繁体   中英

Nokogiri won't let me bundle install in Rails

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?

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!

首先尝试执行此操作sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev ,然后尝试安装

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM