質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.35%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

1回答

743閲覧

ruby on railsでnokogiriのエラーが発生する

rails_ruby_web

総合スコア0

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2021/01/09 13:45

ruby railsを用いたポートフォリオ作成をしています。

発生している問題・エラーメッセージ

nokogiriのエラーが発生します恐らくnokogiri/nokogiriというフォルダがないんだろうと思っているのですがどのように対処したらいいのかが調べきれせんでした

54: from bin/rails:4:in `<main>' 53: from bin/rails:4:in `require' 52: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands.rb:18:in `<top (required)>' 51: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/command.rb:46:in `invoke' 50: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/command/base.rb:69:in `perform' 49: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 48: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 47: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 46: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands/server/server_command.rb:142:in `perform' 45: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands/server/server_command.rb:142:in `tap' 44: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands/server/server_command.rb:145:in `block in perform' 43: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.4/lib/rails/commands/server/server_command.rb:145:in `require' 42: from /Users/ideshouhei/Desktop/yourbookshelf/config/application.rb:7:in `<top (required)>' 41: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require' 40: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require' 39: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each' 38: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require' 37: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each' 36: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require' 35: from /Users/ideshouhei/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `require' 34: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sass-rails-5.1.0/lib/sass-rails.rb:1:in `<top (required)>' 33: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sass-rails-5.1.0/lib/sass-rails.rb:1:in `require' 32: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sass-rails-5.1.0/lib/sass/rails.rb:11:in `<top (required)>' 31: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sass-rails-5.1.0/lib/sass/rails.rb:11:in `require' 30: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sass-rails-5.1.0/lib/sass/rails/railtie.rb:3:in `<top (required)>' 29: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sass-rails-5.1.0/lib/sass/rails/railtie.rb:3:in `require' 28: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/railtie.rb:7:in `<top (required)>' 27: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/railtie.rb:7:in `require' 26: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/context.rb:1:in `<top (required)>' 25: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/context.rb:1:in `require' 24: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers.rb:5:in `<top (required)>' 23: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers.rb:6:in `<module:ActionView>' 22: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers.rb:54:in `<module:Helpers>' 21: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers.rb:54:in `require' 20: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_helper.rb:6:in `<top (required)>' 19: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_helper.rb:6:in `require' 18: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_tag_helper.rb:8:in `<top (required)>' 17: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_tag_helper.rb:10:in `<module:ActionView>' 16: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_tag_helper.rb:16:in `<module:Helpers>' 15: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_tag_helper.rb:20:in `<module:FormTagHelper>' 14: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/form_tag_helper.rb:20:in `require' 13: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/text_helper.rb:6:in `<top (required)>' 12: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/text_helper.rb:8:in `<module:ActionView>' 11: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/text_helper.rb:31:in `<module:Helpers>' 10: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/text_helper.rb:34:in `<module:TextHelper>' 9: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/text_helper.rb:34:in `require' 8: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/sanitize_helper.rb:4:in `<top (required)>' 7: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.4.4/lib/action_view/helpers/sanitize_helper.rb:4:in `require' 6: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/rails-html-sanitizer-1.3.0/lib/rails-html-sanitizer.rb:2:in `<top (required)>' 5: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/rails-html-sanitizer-1.3.0/lib/rails-html-sanitizer.rb:2:in `require' 4: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/loofah-2.7.0/lib/loofah.rb:4:in `<top (required)>' 3: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/loofah-2.7.0/lib/loofah.rb:4:in `require' 2: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.1-x86_64-darwin/lib/nokogiri.rb:11:in `<top (required)>' 1: from /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.1-x86_64-darwin/lib/nokogiri.rb:32:in `rescue in <top (required)>' /Users/ideshouhei/Desktop/yourbookshelf/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.11.1-x86_64-darwin/lib/nokogiri.rb:32:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)

nokogiriのインストールアンインストールなどをすると一時的には発生しなくなるのですが時間が立つと再発してしまします

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

winterboum

2021/01/09 14:05

Gemfile 載せてください。 何をした時にこのエラーが出たのでしょう
rails_ruby_web

2021/01/10 07:50

''' source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.5' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.2' # Use mysql as the database for Active Record gem 'mysql2', '>= 0.4.4', '< 0.6.0' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' # Use ActiveStorage variant gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development gem 'therubyracer' gem 'libv8' gem 'kaminari' gem 'carrierwave' gem 'nokogiri', '~> 1.11.1' # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] ''' gemfileですrails sを実行する際にこのエラーが発生してしまします
winterboum

2021/01/10 09:48

bundle install は成功していますか
rails_ruby_web

2021/01/10 11:06

いろいろ変更を加えてきたのですがinstallは成功しています
guest

回答1

0

ほぼあなたと同じバージョンでrailsアプリを作ってみましたが問題なく起動しました。

=> Booting Puma
=> Rails 5.2.4.4 application starting in development
=> Run rails server -h for more startup options
Puma starting in single mode...

  • Version 3.12.6 (ruby 2.6.6-p146), codename: Llamas in Pajamas
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://localhost:3000

Use Ctrl-C to stop

いろいろ変更を加えてきたのですがinstallは成功しています

成功していません。環境か手順を見直してください。

投稿2021/01/14 13:45

technocore

総合スコア7337

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.35%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問