4
5

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.

sqlite3起因でrails server失敗した場合

Posted at

Ruby on Railsの初心者です。

$ rails server

環境構築をしていて、サーバー起動に失敗TT
↓のエラーに引っかかりました。

Traceback (most recent call last):
        43: from bin/rails:4:in `<main>'
・
・
・
         1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)

半日苦戦してようやく解決、
どうやら新しいバージョンのRubyがリリースされたけれど、sqlite3の方がそのバージョンに対応していないときに起こります。
参考:https://teratail.com/questions/44920

$ gem uninstall -a sqlite3
$ gem install sqlite3 --platform=ruby

再び入力

$ rails server

http://localhost:3000/
にアクセス
Yay!You're on Rails!.PNG

成功です:heart_eyes:

4
5
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
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?