<small id='FPZnK'></small><noframes id='FPZnK'>

    <tfoot id='FPZnK'></tfoot>
    • <bdo id='FPZnK'></bdo><ul id='FPZnK'></ul>
      <i id='FPZnK'><tr id='FPZnK'><dt id='FPZnK'><q id='FPZnK'><span id='FPZnK'><b id='FPZnK'><form id='FPZnK'><ins id='FPZnK'></ins><ul id='FPZnK'></ul><sub id='FPZnK'></sub></form><legend id='FPZnK'></legend><bdo id='FPZnK'><pre id='FPZnK'><center id='FPZnK'></center></pre></bdo></b><th id='FPZnK'></th></span></q></dt></tr></i><div id='FPZnK'><tfoot id='FPZnK'></tfoot><dl id='FPZnK'><fieldset id='FPZnK'></fieldset></dl></div>
    1. <legend id='FPZnK'><style id='FPZnK'><dir id='FPZnK'><q id='FPZnK'></q></dir></style></legend>

      由于缺少 sqlite3 gem,Rails 4.0rc1 应用程序没有运行

      时间:2023-10-26
      <tfoot id='6HXVs'></tfoot>

        <tbody id='6HXVs'></tbody>
      <legend id='6HXVs'><style id='6HXVs'><dir id='6HXVs'><q id='6HXVs'></q></dir></style></legend>

      <small id='6HXVs'></small><noframes id='6HXVs'>

      • <i id='6HXVs'><tr id='6HXVs'><dt id='6HXVs'><q id='6HXVs'><span id='6HXVs'><b id='6HXVs'><form id='6HXVs'><ins id='6HXVs'></ins><ul id='6HXVs'></ul><sub id='6HXVs'></sub></form><legend id='6HXVs'></legend><bdo id='6HXVs'><pre id='6HXVs'><center id='6HXVs'></center></pre></bdo></b><th id='6HXVs'></th></span></q></dt></tr></i><div id='6HXVs'><tfoot id='6HXVs'></tfoot><dl id='6HXVs'><fieldset id='6HXVs'></fieldset></dl></div>

          <bdo id='6HXVs'></bdo><ul id='6HXVs'></ul>
                本文介绍了由于缺少 sqlite3 gem,Rails 4.0rc1 应用程序没有运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我第一次尝试安装 Rails 4.0.在带有 Ruby 2.0 x64 的 Windows 8 上.冉:

                First time I've tried installing Rails 4.0. On Windows 8 with Ruby 2.0 x64. Ran:

                gem install rails --version 4.0.0.rc1 --no-ri --no-rdoc
                

                然后我跑:

                rails new test_app
                cd test_app
                rails s
                

                但是localhost:3000的网页报错如下:

                为数据库适配器指定了sqlite3",但未加载 gem.将 gem 'sqlite3' 添加到您的 Gemfile.

                Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile.

                它在我的 Gemfile 中:

                It's there in my Gemfile:

                gem 'sqlite3'
                

                我尝试多次运行 bundle install,但它甚至没有在所有其他 gem 中列出它.

                I tried running bundle install several times and it doesn't even list it among all the other gems.

                更新:我尝试以两种不同的方式安装 sqlite3 gem,都使用从 DevKit 的 msys.bat 文件打开的终端.下面提到的@szines 的方式给了我以下错误:

                UPDATE: I've tried installing the sqlite3 gem in 2 different ways, both using the terminal that opens from the msys.bat file from the DevKit. The way the @szines below mentions gives me the following error:

                $ gem install sqlite3 --platform=ruby -- --with-opt-dir=c:/sqlite-amalgamation-3071602
                Temporarily enhancing PATH to include DevKit...
                Building native extensions with: '--with-opt-dir=c:/sqlite-amalgamation-3071602'
                This could take a while...
                ERROR:  Error installing sqlite3:
                        ERROR: Failed to build gem native extension.
                
                    c:/Ruby200-x64/bin/ruby.exe extconf.rb --with-opt-dir=c:/sqlite-amalgamation-3071602
                checking for sqlite3.h... yes
                checking for sqlite3_libversion_number()... -lsqlite3
                sqlite3 is missing. Install SQLite3 from http://www.sqlite.org/ first.
                *** 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
                        --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 will remain installed in c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7 for inspection.
                Results logged to c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
                

                另一方面,我使用 sqlite.org 中的 autoconf 包,并且我能够编译和安装 sqlite3 gem.但是,当我尝试打开 Rails 服务器时,出现以下错误:

                The other way, I use the autoconf package from sqlite.org and I am able to compile and install the sqlite3 gem. However, when I try to open the Rails server I get the following error:

                C:UsersmeRubymineProjectsmy_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)
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `rescue in <top (required)>'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/lib/sqlite3.rb:2:in `<top (required)>'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
                        from 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'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
                        from C:/Users/me/RubymineProjects/my_project/config/application.rb:7:in `<top (required)>'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require'
                        from 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)>'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap'
                        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>'
                        from bin/rails:4:in `require'
                        from bin/rails:4:in `<main>'
                

                推荐答案

                很烦人,但我终于让它工作了.您基本上必须执行以下操作:

                Pretty annoying, but I finally got it working. You basically have to do the following:

                1. 下载准备编译的sqlite文件 作者 Luis Lavena(这是 x64)
                2. 使用 7-zip 解压到`c:sqlite3
                3. 从您将 DevKit 解压到的 DevKit 文件夹中运行 msys.bat
                4. 运行 gem install sqlite3 --platform=ruby -- --with-opt-dir=C:/sqlite3
                1. Download sqlite files ready to be compiled by Luis Lavena (this is x64)
                2. Unarchive with 7-zip to maybe `c:sqlite3
                3. Run msys.bat from within the DevKit folder you unarchived DevKit to
                4. Run gem install sqlite3 --platform=ruby -- --with-opt-dir=C:/sqlite3

                这篇关于由于缺少 sqlite3 gem,Rails 4.0rc1 应用程序没有运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:尝试更新 mySQL 中的 640k 行会出现“查询期间与 MySQL 服务器的连接丢失" 下一篇:MySQL 监听通知等效

                相关文章

                <i id='7yqdd'><tr id='7yqdd'><dt id='7yqdd'><q id='7yqdd'><span id='7yqdd'><b id='7yqdd'><form id='7yqdd'><ins id='7yqdd'></ins><ul id='7yqdd'></ul><sub id='7yqdd'></sub></form><legend id='7yqdd'></legend><bdo id='7yqdd'><pre id='7yqdd'><center id='7yqdd'></center></pre></bdo></b><th id='7yqdd'></th></span></q></dt></tr></i><div id='7yqdd'><tfoot id='7yqdd'></tfoot><dl id='7yqdd'><fieldset id='7yqdd'></fieldset></dl></div>
              1. <legend id='7yqdd'><style id='7yqdd'><dir id='7yqdd'><q id='7yqdd'></q></dir></style></legend>

                1. <small id='7yqdd'></small><noframes id='7yqdd'>

                  <tfoot id='7yqdd'></tfoot>
                      <bdo id='7yqdd'></bdo><ul id='7yqdd'></ul>