You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't Build Site Locally: bundle install failed with "An error occurred while installing nokogiri (1.8.4)" #1150
I try to build and view the site locally. When I run bundle install, I got
Errno::EACCES: Permission denied @ rb_sysopen -
/Users/USERNAME/DIR/DIR/DIR/docs.scala-lang/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4/.autotest
An error occurred while installing nokogiri (1.8.4), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.4' --source 'https://rubygems.org/'` succeeds
before bundling.
When I installed nokogiri manually and successfully by running gem install nokogiri -v '1.8.4' --source 'https://rubygems.org/', and then run bundle install, same error appears.
I am using macOS Sierra version 10.12.3
yifans-MacBook-Pro:docs.scala-lang yifanxing$ bundle exec jekyll serve -I
Could not find gem 'jekyll-redirect-from' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
yifans-MacBook-Pro:docs.scala-lang yifanxing$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using concurrent-ruby 1.0.5
Using i18n 0.9.5
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.1
Using public_suffix 3.0.3
Using addressable 2.5.2
Using bundler 1.16.5
Using colorator 1.1.0
Using colorize 0.8.1
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Using ffi 1.9.25
Using ethon 0.11.0
Using forwardable-extended 2.6.0
Using mercenary 0.3.6
Using mini_portile2 2.3.0
Fetching nokogiri 1.8.4
Installing nokogiri 1.8.4 with native extensions
**Errno::EACCES: Permission denied @ rb_sysopen -
/Users/USERNAME/DIR/DIR/DIR/docs.scala-lang/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4/.autotest
An error occurred while installing nokogiri (1.8.4), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.4' --source 'https://rubygems.org/'` succeeds
before bundling.**
In Gemfile:
html-proofer was resolved to 3.9.2, which depends on
nokogiri
yifans-MacBook-Pro:docs.scala-lang yifanxing$ **gem install nokogiri -v '1.8.4' --source** 'https://rubygems.org/'
Building native extensions. This could take a while...
/Users/yifanxing/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /Users/USERNAME/DIR/DIR in PATH, mode 040777
Successfully installed nokogiri-1.8.4
Parsing documentation for nokogiri-1.8.4
Done installing documentation for nokogiri after 7 seconds
1 gem installed
yifans-MacBook-Pro:docs.scala-lang yifanxing$
changed the title [-]Can't Start Server: bundle install failed with "An error occurred while installing nokogiri (1.8.4)"[/-][+]Can't Build Site Locally: bundle install failed with "An error occurred while installing nokogiri (1.8.4)"[/+]on Sep 21, 2018
I know I've hit this more than once before, googled it before, resolved it somehow, and then forgotten what I did. see e.g. sparklemotion/nokogiri#1504
If anyone knows the solution, we should add it to the doc here. (And yes, I should have done it myself before... ah, well, I guess I didn't know yet whether it would turn into something of an FAQ.)
Or maybe whatever nokogiri problem this is isn't the same one I hit, I just know that I remember nokogiri being trouble.
sigh, on my M1 Mac on macOS 12.1 (Monterey) I'm getting:
'/Users/tisue/docs.scala-lang/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.12.5-x86_64-darwin/lib/nokogiri/2.6/nokogiri.bundle' (mach-o file, but is an incompatible architecture (have
'x86_64', need 'arm64e')), '/usr/lib/nokogiri.bundle' (no such file) -
Activity
[-]Can't Start Server: bundle install failed with "An error occurred while installing nokogiri (1.8.4)"[/-][+]Can't Build Site Locally: bundle install failed with "An error occurred while installing nokogiri (1.8.4)"[/+]SethTisue commentedon Sep 26, 2018
I know I've hit this more than once before, googled it before, resolved it somehow, and then forgotten what I did. see e.g. sparklemotion/nokogiri#1504
If anyone knows the solution, we should add it to the doc here. (And yes, I should have done it myself before... ah, well, I guess I didn't know yet whether it would turn into something of an FAQ.)
Or maybe whatever nokogiri problem this is isn't the same one I hit, I just know that I remember nokogiri being trouble.
kotobotov commentedon Jan 9, 2019
i had some problem with ruby ecosystem too, and just use docker, as i mention at docker support pull request.
SethTisue commentedon Feb 11, 2019
I think I remember now that
xcode-select --installused to fix this. @xingyif you might try thatBut also, I hit this today and
xcode-select --installdidn't fix it. I think what I am experiencing is a new problem on MacOS 10.14 (Yifan's report was on 10.12). The problem is: described here: https://silvae86.github.io/sysadmin/mac/osx/mojave/beta/libxml2/2018/07/05/fixing-missing-headers-for-homebrew-in-mac-osx-mojave/And the upshot is, this fixes it:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /SethTisue commentedon Feb 11, 2019
(I opened #1286 on my troubles with this option)
SethTisue commentedon Feb 15, 2019
closing on the assumption that any trouble is fixable via some combination of:
93510f5 adds a link to this ticket from the readme
SethTisue commentedon Feb 7, 2022
sigh, on my M1 Mac on macOS 12.1 (Monterey) I'm getting:
SethTisue commentedon Feb 7, 2022
this seems promising: https://www.earthinversion.com/blogging/how-to-install-jekyll-on-appple-m1-macbook/
SethTisue commentedon Feb 7, 2022
that worked
byyue commentedon Feb 25, 2022
In case it doesn't work, try:
bundle update nokogiriSethTisue commentedon Apr 27, 2023
#2779 may also be helpful for Mac users