Ruby on rails 在Rails 3上使用sunspot和postgres导入数据失败

Ruby on rails 在Rails 3上使用sunspot和postgres导入数据失败,ruby-on-rails,sunspot,rails-postgresql,sunspot-rails,sunspot-solr,Ruby On Rails,Sunspot,Rails Postgresql,Sunspot Rails,Sunspot Solr,我编写了一个rake文件将自动生成的项目导入数据库 当我删除所有并重新导入时 开发日志如下所示 7 Connecting to database specified by database.yml 8 (0.5ms) BEGIN 9 Book Exists (1.1ms) SELECT 1 AS one FROM "books" WHERE "books"."sn" = 2123000001 LIMIT 1 当我使用rails控制台或rails db查找表“Book”时

我编写了一个rake文件将自动生成的项目导入数据库

当我删除所有并重新导入时

开发日志如下所示

 7 Connecting to database specified by database.yml
  8    (0.5ms)  BEGIN
  9   Book Exists (1.1ms)  SELECT 1 AS one FROM "books" WHERE "books"."sn" = 2123000001 LIMIT 1
当我使用rails控制台或rails db查找表“Book”时

该表为空,因为我执行了delete_all()

所以,我不知道为什么我重新导入数据并告诉我数据已经存在

我试图通过RAILS\u ENV=production和RAILS\u ENV=development查找我的数据库

我的生产数据库中没有任何内容,因为我没有在生产模式下运行

有什么想法吗

rake aborted!
RSolr::Error::Http - 500 Internal Server Error
Error:     Severe errors in solr configuration.

Check your log files for more detailed information on what may be wrong.

If you want solr to continue after configuration errors, change:

 <abortOnConfigurationError>false</abortOnConfigurationError>

in solr.xml

-------------------------------------------------------------

Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">Book 431</field><field name=\"type\">Book</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">Book</field><field name=\"name_text\">剩食</field><field name=\"author_text\">陳曉蕾著</field><field name=\"comment_text\">在消費主義盛行的年代,如何跳脫買得越多、剩得越多、對環境破壞越多的惡性循環?本書憑藉豐富數據、照片與精闢的分析,讓讀者自然而然願意開始「三思而後食」。(黃宗慧)</field><field name=\"sale_type_text\">normal</field><field name=\"category_text\">體育</field></doc></add>"

可能会打开其他环境。尝试以下方法:

rake RAILS_ENV=developmant your_generator

当您打开console时,您可以看到它打开了哪个环境

可能会打开其他环境。尝试以下方法:

rake RAILS_ENV=developmant your_generator

当您打开console时,您可以看到它打开的环境未工作。因为我从来没有在生产模式下运行过。生产中的表为空。是否也检查测试环境?未工作。因为我从来没有在生产模式下运行过。生产中的表为空。是否也检查测试环境?