Skip to content

Can't Build Site Locally: bundle install failed with "An error occurred while installing nokogiri (1.8.4)" #1150

Closed
@xingyif

Description

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$ 

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions