1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

nokogiriのインストールに詰まった

Last updated at Posted at 2020-03-01

昔作っていたRailsアプリを久しぶりに開いてリファクタしようと思ったときのことの備忘録です。

rails s

/Users/***/Desktop/Ruby/***_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- /Users/***/Desktop/Ruby/***_app/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.10.3/lib/nokogiri/nokogiri.bundle (LoadError)

なんか色々試してエラーが変わった

gem installしたときに Permission denied @ rb_sysopen

こちら(Permission denied @ rb_sysopen
まさに環境も全く同じだったので
最後のコマンド

rbenv install 2.5.1

をうった

gem uninstall nokogiri

でnokogiriが入っていないことを確認

 bundle install

失敗

この記事通りにやって見た(nokogiriのインストールに失敗する問題)

brew install --force libxml2
brew link libxml2
Warning: Refusing to link macOS-provided software: libxml2
If you need to have libxml2 first in your PATH run:
  echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.zshrc

For compilers to find libxml2 you may need to set:
  export LDFLAGS="-L/usr/local/opt/libxml2/lib"
  export CPPFLAGS="-I/usr/local/opt/libxml2/include"

For pkg-config to find libxml2 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

やっぱ権限ないって言われる

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/***/.rbenv/gems/2.5.0/gems/nokogiri-1.10.8/LICENSE-DEPENDENCIES.md

ライセンス...?

なんか昔メールでgithubからnokogiriの件でなんか来てた気がする。。確認
スクリーンショット 2020-02-29 15.00.21.png

まじか...バージョン変えてみよう

gem 'nokogiri', '~> 1.10.1'
↓
gem "nokogiri", ">= 1.10.8"
bundle install
You have requested:
  nokogiri >= 1.10.8

The bundle currently has nokogiri locked at 1.10.3.
Try running `bundle update nokogiri`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
bundle update

bundle instaillはとおった!

rails s
Could not find 'nokogiri' (>= 1.6) among 1151 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/***/.gem/ruby/2.5.0:/Users/***/.rbenv/gems/2.5.0', execute `gem env` for more information

ん。。一回ギブ

次の日

とりあえずgemの更新だけをgitにあげよう。。。(herokuにも自動push)

なんかherokuからおこられて

###### WARNING:
       This buildpack was created as a stop-gap measure to allow running applications with Bundler 2 on Heroku.
       Heroku now supports Bundler 2 directly: https://devcenter.heroku.com/changelog-items/1563
       
       Please discontinue use of this buildpack and instead directly use the `heroku/ruby` buildpack.
       
       To remove this buildpack use the `heroku buildpacks` command to list your existing buildpacks.
       
       If you only have one buildpack listed you can run:
       
       ```
       heroku buildpacks:set heroku/ruby
       ```
       
       If you have multiple buildpacks, you'll need to add the buildpack to the correct location using
       `heroku buildpacks:add heroku/ruby -i <correct index>` and then remove this buildpack via:
       
       ```
       heroku buildpacks:remove https://github.com/bundler/heroku-buildpack-bundler2
       ```

コマンドを打って見た。

githubにきてたgemの更新のプルリクが全部closeされ、よくわからないけどrails sできるようになっていた...

わからん。。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?