sqlite - Rails 4.0rc1 app not running due to missing sqlite3 gem -
first time i've tried installing rails 4.0. on windows 8 ruby 2.0 x64. ran:
gem install rails --version 4.0.0.rc1 --no-ri --no-rdoc
then run:
rails new test_app cd test_app rails s
but webpage @ localhost:3000
reports following error:
specified 'sqlite3' database adapter, gem not loaded. add
gem 'sqlite3'
gemfile.
it's there in gemfile:
gem 'sqlite3'
i tried running bundle install
several times , doesn't list among other gems.
update: i've tried installing sqlite3 gem in 2 different ways, both using terminal opens msys.bat file devkit. way @szines below mentions gives me following error:
$ gem install sqlite3 --platform=ruby -- --with-opt-dir=c:/sqlite-amalgamation-3071602 temporarily enhancing path include devkit... building native extensions with: '--with-opt-dir=c:/sqlite-amalgamation-3071602' take while... error: error installing sqlite3: error: failed build gem native extension. c:/ruby200-x64/bin/ruby.exe extconf.rb --with-opt-dir=c:/sqlite-amalgamation-3071602 checking sqlite3.h... yes checking sqlite3_libversion_number()... -lsqlite3 sqlite3 missing. install sqlite3 http://www.sqlite.org/ first. *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. provided configuration options: --with-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=c:/ruby200-x64/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 --with-sqlite3lib --without-sqlite3lib gem files remain installed in c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7 inspection. results logged c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
the other way, use autoconf package sqlite.org , able compile , install sqlite3 gem. however, when try open rails server following error:
c:\users\me\rubymineprojects\my_project>rails s c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (loaderror) c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `rescue in <top (required)>' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:2:in `<top (required)>' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' c:/users/me/rubymineprojects/my_project/config/application.rb:7:in `<top (required)>' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `block in <top (required)>' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap' c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>' bin/rails:4:in `require' bin/rails:4:in `<main>'
pretty annoying, got working. have following:
- download sqlite files ready compiled luis lavena (this x64)
- unarchive 7-zip maybe `c:\sqlite3
- run msys.bat within devkit folder unarchived devkit to
- run
gem install sqlite3 --platform=ruby -- --with-opt-dir=c:/sqlite3
Comments
Post a Comment