我正在尝试使用rake db创建数据库:create我收到以下错误
** 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文件并且它是空的。我是JRuby的新手。我在我的项目中使用以下gems列表,它显示有两个数据库,其中一个是pg,另一个是sqlite,它们与ActiveRecord-JDBC adapter一起使用。我的gem文件看起来像:
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'
任何想法?
答案 0 :(得分:0)
您是否故意使用旧的activerecord版本? (3.0)?为什么你的database.yml为空,你可以尝试使用正确的值填充它:)