2016-09-16 3 views
2

I'vは、コマンドを実行しますルビーのインストーラとレール5を使用してWindows 10の64ビットにルビー、開発キットとルビーバージョン2.3.1p112をインストールしている間:sqlite3のロードエラー開始rails5サーバ

rails new app

をI'vは私を得ました

:私それで cdが、その後

bundle install rails s

を実行しますが、I'vは、このエラーを得た新しいアプリケーションディレクトリ

s.require_paths = ["lib/sqlite3_native"]

が、同じエラーが表示されます。これに

s.require_paths = ["lib"]

:10

LoadError (Could not load 'active_record/connection_adapters/sqlite3_adapter'. 
Make sure that the adapter in config/database.yml is valid. 
If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' 
add the necessary adapter gem to the Gemfile.): 

I'vは、このから10行目でsqlite3-1.3.11-x86-mingw32.gemspecファイルを編集します。

datebase.yml

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
# 
default: &default 
    adapter: sqlite3 
    pool: 5 
    timeout: 5000 

development: 
    <<: *default 
    database: db/development.sqlite3 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    <<: *default 
    database: db/test.sqlite3 

production: 
    <<: *default 
    database: db/production.sqlite3 

これは私のGemfile次のとおりです。

source 'https://rubygems.org' 

# Use credit_debit_card_number_validator to validate and generate card numbers 
gem 'credit_debit_card_number_validator' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.0', '>= 5.0.0.1' 
# Use Puma as the app server 
gem 'puma', '~> 3.0' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', platform: :mri 

    # Use sqlite3 as the database for Active Record 
    gem 'sqlite3' 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console' 
end 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

と、これはApplication traceです:

This error occurred while loading the following files: 

active_record /ベース

最後に、これはFramework traceです:

activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `block in require' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:259:in `load_dependency' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require' 
activerecord (5.0.0.1) lib/active_record/connection_adapters/sqlite3_adapter.rb:8:in `<top (required)>' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `block in require' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:259:in `load_dependency' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require' 
activerecord (5.0.0.1) lib/active_record/connection_adapters/connection_specification.rb:174:in `spec' 
activerecord (5.0.0.1) lib/active_record/connection_handling.rb:53:in `establish_connection' 
activerecord (5.0.0.1) lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>' 
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' 
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' 
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks' 
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:44:in `each' 
activesupport (5.0.0.1) lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks' 
activerecord (5.0.0.1) lib/active_record/base.rb:324:in `<module:ActiveRecord>' 
activerecord (5.0.0.1) lib/active_record/base.rb:24:in `<top (required)>' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `block in require' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:259:in `load_dependency' 
activesupport (5.0.0.1) lib/active_support/dependencies.rb:293:in `require' 
activerecord (5.0.0.1) lib/active_record/migration.rb:558:in `connection' 
activerecord (5.0.0.1) lib/active_record/migration.rb:545:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call' 
activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__' 
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks' 
activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call' 
web-console (3.3.1) lib/web_console/middleware.rb:131:in `call_app' 
web-console (3.3.1) lib/web_console/middleware.rb:28:in `block in call' 
web-console (3.3.1) lib/web_console/middleware.rb:18:in `catch' 
web-console (3.3.1) lib/web_console/middleware.rb:18:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' 
railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app' 
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `block in call' 
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `block in tagged' 
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in `tagged' 
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `tagged' 
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `call' 
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call' 
rack (2.0.1) lib/rack/method_override.rb:22:in `call' 
rack (2.0.1) lib/rack/runtime.rb:22:in `call' 
activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call' 
actionpack (5.0.0.1) lib/action_dispatch/middleware/static.rb:136:in `call' 
rack (2.0.1) lib/rack/sendfile.rb:111:in `call' 
railties (5.0.0.1) lib/rails/engine.rb:522:in `call' 
puma (3.6.0) lib/puma/configuration.rb:225:in `call' 
puma (3.6.0) lib/puma/server.rb:578:in `handle_request' 
puma (3.6.0) lib/puma/server.rb:415:in `process_client' 
puma (3.6.0) lib/puma/server.rb:275:in `block in run' 
puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread' 
+0

この 'gem uninstall sqlite3'と' bundle install'を試してみてください。 –

+0

この問題の複製http://stackoverflow.com/questions/36963018/error-incompatible-library-version-sqlite3-1-3-11-in-rails –

+0

生産: <<:* default データベース:db/production.sqlite3 Look on this – Mukesh

答えて

0

まずそれが機能しなかった場合は、ユーザー名とパスワードとあなたを持っていないことを確認してください

bundle install 

を実行し

gem uninstall sqlite3 

を試してみてください環境変数はokです。

最後に、プロダクションでさらに役立つようにpostgresqlを使用してみましょう。

+1

を最後に言いました。 'sqlite3'をアンインストールして' pg'バージョン '0.19.0.pre20160904200247'をインストールすると'〜0.18' 、 提案ありがとう :) – AliOsm

関連する問題