2016-04-14 16 views
0

Rails'e yeni geliyorum ve sunucumu başlatmaya çalışıyordum. komutu rails server Koşu Bunları önceki soruların birçoğunun baktı bir hataVeritabanı bağdaştırıcısı için sqlite3 belirtildi, ancak gem yüklenmedi

Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

oluşturulan ve hiçbiri bunu çözmek gibi görünüyor.

# Add your own tasks in files placed in lib/tasks ending in .rake, 
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 

require File.expand_path('../config/application', __FILE__) 
require 'rake' 

Listr::Application.load_tasks 

task :travis => ['db:create:all', 'db:migrate', :default] 

Ayrıca herhangi sağlamak için takdir edilecektir: İşte benim rakefile kod benim database.yml dosya İşte

# SQLite version 3.x 
# gem install sqlite3 
development: 
    adapter: sqlite3 
    database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# 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: 
    adapter: sqlite3 
    database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000` 

benim Gemfile kodu

if RUBY_VERSION =~ /1.9/ 
    Encoding.default_external = Encoding::UTF_8 
    Encoding.default_internal = Encoding::UTF_8 
end 

source 'https://rubygems.org' 

gem 'rails', '~> 4.2.0' 

gem 'ey_config' 
gem 'rails_autolink' 
gem 'simple_form' 

# Assets 
gem 'jquery-rails' 
gem 'sass-rails' 
gem 'coffee-rails' 
gem 'uglifier' 

platform :ruby do 
    gem 'mysql2' 
    gem 'pg' 
    gem 'activerecord-postgis-adapter', '3.0.0.beta2' 
    gem 'sqlite3' 

    gem 'newrelic_rpm' 
    gem 'unicorn' 
    gem 'puma' 
    gem 'json' 
    gem 'minitest' 
    gem 'psych' 
    gem 'racc' 
end 

platforms :jruby do 
    ar_jdbc_version = '~> 1.3' 
    gem 'activerecord-jdbc-adapter', ar_jdbc_version 
    gem 'activerecord-jdbcmysql-adapter', ar_jdbc_version 
    gem 'activerecord-jdbcpostgresql-adapter', ar_jdbc_version 
    gem 'activerecord-jdbcsqlite3-adapter', ar_jdbc_version 
    gem 'jdbc-mysql', :require => false 
    gem 'jdbc-sqlite3', :require => false 
    gem 'jdbc-postgres', :require => false 

    gem 'jruby-openssl' 
    gem 'trinidad' 
end 

platform :rbx do 
    gem 'rubysl' 
    gem 'rubysl-test-unit', :require => false 
end 

# Bundle gems for the local environment. Make sure to 
# put test-only gems in this group so their generators 
# and rake tasks are available in development mode: 
group :development, :test do 
    gem 'tzinfo-data' 
end 

Ve burada cevaba eşlik eden açıklama. Teşekkürler.

cevap

0

sqlite3 geminiz, Gemfile'da nereden aldığınızdan dolayı yüklenmiyor. `Gemfile veya .bundle/directory` bulunamıyor: abhilash.reddy kod güncellendi ve şimdi bir hata veren update` paket` çalıştırmak @ sağ altında gem 'rails', '~> 4.2.0'

+0

etsin, platform :ruby do dışarı atın ve bu blok dışında yerleştirin –

+0

emin misiniz, Uygulamanın kök dizininde misiniz? Bu hata, kök dizininin dışında bir paket çalıştırdığınızda gelir –

+0

Sorunu çözdüyse bana bildirin .. –

İlgili konular