2014-02-21 89 views
0

最近我一直在使用ruby,我非常喜欢这种语言,并且非常快速地选择它,我决定是时候尝试使用Rails框架了。当我尝试创建一个新的项目我的打字Ruby On Rails创建新项目时出现SQLite错误

rails new first-site 

我收到以下错误,我已经花了几个小时谷歌搜索,并没有发现任何类似的结果

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /usr/local/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. You may 
need configuration options. 

Provided configuration options: 
--with-opt-dir 
--without-opt-dir 
--with-opt-include 
--without-opt-include=${opt-dir}/include 
--with-opt-lib 
--without-opt-lib=${opt-dir}/lib 
--with-make-prog 
--without-make-prog 
--srcdir=. 
--curdir 
--ruby=/usr/local/bin/ruby 
--with-sqlite3-dir 
--without-sqlite3-dir 
--with-sqlite3-include 
--without-sqlite3-include=${sqlite3-dir}/include 
--with-sqlite3-lib 
--without-sqlite3-lib=${sqlite3-dir}/ 
--enable-local 
--disable-local 


Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.8 for inspection. 
Results logged to /usr/local/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3 /gem_make.out 
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue. 
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling. 

我再运行安装宝石sqlite3 -v'1.3.8'并且得到类似的错误。 我不知道我在做什么错。

回答

0

看起来你需要安装的SQLite

也就是说在

sqlite3.h is missing. Try 'port install sqlite3 +universal' 
or 'yum install sqlite-devel' 

如果您有其他DB设置喜欢的Postgres你可以与数据库开关

rails new myapp --database=postgresql 
+0

我使用Kali linux,所以这些工作都没有。我尝试了apt-get安装也没有工作。 @emcanes – Sloth

0

我运行发现我在尝试使用MySQL gem时错过了开发人员依赖关系。现在所有已修复:)

相关问题