sandbox-memo

開発してて出たエラーをメモる場所

rails new blogしたらエラーでた

Getting Started with Rails — Ruby on Rails Guides

rails new blog

したら以下のようなエラーがでた。

An error occurred while installing sqlite3 (1.3.13), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.13' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  sqlite3
[vagrant@localhost blog]$ gem install sqlite3 -v '1.3.13' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.

    current directory: /home/vagrant/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13/ext/sqlite3
/home/vagrant/.rbenv/versions/2.5.3/bin/ruby -r ./siteconf20181125-6435-7i5da6.rb extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'brew install sqlite3',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).

書いてあるとおり

gem install sqlite3 -v '1.3.13' --source 'https://rubygems.org/

をしてから

bundle update

してみたけど変わらずエラーが。

よく見たら下の方にsqlite-develいれろって書いてあるので

yum install sqlite-devel

したら解消できた。