0
我試圖用耙分貝來創建數據庫:創建我收到以下錯誤收到一個錯誤,同時創建數據庫
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
rake aborted!
undefined method `[]' for false:FalseClass
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.10/lib/active_record/railties
/databases.rake:32:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => db:create
我檢查了我的database.yml文件,它是empty.I是新來的JRuby的。我用我的項目寶石下面的列表,並顯示有兩個數據庫有一個是PG等是與使用的SQLite的ActiveRecord-JDBC adapter.My寶石文件看起來像:
gem 'rails', '~>3.0.10'
gem 'builder', '~> 2.1.2'
gem 'exception_notification', '~> 2.5.2'
gem 'rubyzip', :require => 'zip/zip'
gem 'haml', '3.1.3' #, :git => 'git://github.com/nex3/haml.git'
gem 'sass', '3.1.7' #, :git => 'git://github.com/nex3/haml.git'
gem 'compass', '0.11.5' #, :git => 'git://github.com/chriseppstein/compass.git'
gem 'formtastic', '2.0.0.rc4' #, :git => 'git://github.com/justinfrench/formtastic.git'
gem 'inherited_resources', '1.3.0 ' #, :git => 'git://github.com/josevalim/inherited_resources.git'
gem 'simple-navigation', '3.5.0' #, :git => 'git://github.com/andi/simple-navigation.git'
gem 'tabs_on_rails', '2.0.2' #, :git => 'git://github.com/weppos/tabs_on_rails.git'
gem 'dynamic_form', '1.1.4' #, :git => 'git://github.com/rails/dynamic_form.git'
gem 'show_for', '0.2.4'
gem 'liquid', '2.3.0'
gem 'crack'
gem 'jquery-rails', '1.0.14'
gem 'jrails', '0.6.0'
gem 'sprockets', '1.0.2'
gem 'hominid', '3.0.4'
platforms :jruby do
gem 'ActiveRecord-JDBC', '0.5'
gem 'activerecord-jdbcpostgresql-adapter', '1.2.0'
gem 'activerecord-jdbcsqlite3-adapter', '1.2.0'
end
platforms :ruby do
gem 'pg', '0.13.2'
gem 'sqlite3', '1.3.4'
end
gem 'silent-postgres', '0.1.1'
gem 'automatic_foreign_key', '1.3.0'
gem 'friendly_id', '~> 4.0.3'
gem 'rack-ssl', :require => 'rack/ssl'
# paginators
gem 'kaminari', '~> 0.12.4'
gem 'aasm', '~> 3.0.6'
gem "meta_search", '1.0.6' #, :git => 'git://github.com/ernie/meta_search.git'
gem 'devise', '1.5.3' #, :git => 'git://github.com/plataformatec/devise.git'
gem 'cancan', '1.6.5' #, :git => 'git://github.com/plataformatec/devise.git'
gem 'nokogiri', '1.5.0'
gem 'hpricot', '0.8.4'
gem 'jruby-rack', '1.0.10', :platforms => :jruby
gem 'rack', '1.2.3'
gem 'rack-html5', '1.0.2'
gem 'rack-html5-rails_helper', '1.0.1'
gem 'html5-boilerplate', '1.0.0'
gem 'rmagick', '2.13.1', :platforms => :ruby
gem 'rmagick4j', '0.3.7', :platforms => :jruby
gem 'jruby-openssl', '0.7.4', :platforms => :jruby
gem 'ruby_parser', '2.0.6'
gem 'delayed_job', '2.1.4', :platforms => :ruby
gem 'resque', '1.19.0', :platforms => :jruby
gem 'clockwork', '0.2.4'
gem 'stalker', '0.9.0'
gem 'meta-tags', '1.2.4', :require => 'meta_tags'
gem 'carrierwave', '0.5.7'
gem 'mini_magick', '3.3'
gem 'activemerchant', '~> 1.22.0'
gem 'xeroizer', '~> 0.4.1'
gem 'quickeebooks', :git => 'git://github.com/ruckus/quickeebooks.git'
gem 'bson_ext'
gem 'mongo_mapper'
group :development do
gem 'capistrano', '2.9.0'
gem 'capistrano-ext'
gem 'rvm-capistrano', '~> 1.0.2'
gem 'awesome_print', '0.4.0'
end
gem 'backup', '=3.0.22' # :git => 'git://github.com/meskyanichi/backup.git'
gem 'whenever', :require => false
gem 'roo', '1.9.7'
gem 'ffaker', '1.8.1'
gem 'ckeditor', '3.6.3'
gem 'rake', '0.9.2.2'
gem 'ssl_requirement', '0.1.0'
gem 'unicorn', '4.1.1'
有任何想法嗎??
感謝Hugo的回覆,但正如我所說我是新的JRUBY,我正在使用別人的代碼,他們正在使用兩個數據庫,你可以在gemfile中看到。注意版本他們使用gem'ActiveRecord-JDBC','0.5'。我正在使用Rails 3.0.10與紅寶石1.9.2p290 ..任何幫助?? –
Gemfile僅包含數據庫的'驅動程序'。 database.yml數據庫的連接設置和位置。像這樣:https://gist.github.com/961978 –
我試過用sqlite,但它給了我錯誤,數據庫已經存在.. –