“rails new”実行時、sqlite3.h is missingのエラー発生

railsインストール後、”rails new”でアプリを新規作成を試みたところ”sqlite3.h is missing”のエラー発生が発生しました。エラー解決時の対応をまとめました。

$ rails new blog
  :
Installing sass-rails (3.2.6)
Installing sqlite3 (1.3.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.

 
●sqlite3.hを含むパッケージを検索
 
“sqlite3.h is missing”とあります。 yumコマンドで、”sqlite3.h”を含むパッケージを検索します。

$ yum provides "*sqlite3.h"
  :
sqlite-devel-3.6.20-1.el6.i686 : Development tools for the sqlite3 embeddable
                               : SQL database engine
Repo        : base
Matched from:
Filename    : /usr/include/sqlite3.h

 
sqlite-develに含まれているので、sqlite-develをインストールします。
 
●sqlite-develインストール
 

# yum install sqlite-devel
  :
Installed:
  sqlite-devel.x86_64 0:3.6.20-1.el6

Dependency Installed:
  pkgconfig.x86_64 1:0.23-9.1.el6

Complete!

 
●rails newでアプリ新規作成
 

$ rails new blog
  :
Using sqlite3 (1.3.7)
Using uglifier (1.3.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

 
正常にアプリを新規作成できました。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です