- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将开发数据库从SQLite切换到了postgresql。我的应用程序可同时用于开发和生产(Heroku,postgresql),但是现在我无法在新的postgresql开发数据库中修改,删除或创建记录。用户只能登录,查看其个人资料信息并仅正确注销。
创建用户时出错:
ActiveRecord::StatementInvalid in Devise::RegistrationsController#create
Errno::EBADF: Bad file descriptor - rb_thread_select(): INSERT INTO "users" ("field1", "field2", "field3", ...etc continues through..., "Field28") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28) RETURNING "id"
ActiveRecord::StatementInvalid in Devise::RegistrationsController#destroy
Errno::EBADF: Bad file descriptor - rb_thread_select(): DELETE FROM "users" WHERE "users"."id" = $1
rake db:migrate
正确创建了字段,但该应用无法创建记录。
db:schema:load
与#1具有相同的结果。
pgbackups
从生产应用程序中创建
.dump
文件,然后使用
pgrestore
进入新的空数据库。一切看起来不错,字段和记录,但仍然无法修改,删除或创建。只能登录,并查看用户个人资料。
psql mydatabase
命令行直接与数据库进行交互。
development:
adapter: postgresql
encoding: unicode
database: devdatabase
pool: 5
username: postgres
password: 'password'
test:
adapter: postgresql
encoding: unicode
database: testdatabase
pool: 5
username: postgress
password: 'password'
2013-04-18 15:12:09 EDT LOG: database system was shut down at 2013-04-18 15:03:00 EDT
2013-04-18 15:12:09 EDT LOG: database system is ready to accept connections
2013-04-18 15:12:09 EDT LOG: autovacuum launcher started
2013-04-18 15:12:10 EDT LOG: connection received: host=::1 port=58635
2013-04-18 15:13:14 EDT LOG: connection received: host=::1 port=58637
2013-04-18 15:13:14 EDT LOG: connection authorized: user=postgres database=brdevelopment
2013-04-18 15:13:25 EDT LOG: connection received: host=::1 port=58653
2013-04-18 15:13:25 EDT LOG: connection authorized: user=postgres database=brdevelopment
2013-04-18 15:18:32 EDT LOG: received fast shutdown request
2013-04-18 15:18:32 EDT LOG: aborting any active transactions
2013-04-18 15:18:32 EDT LOG: autovacuum launcher shutting down
2013-04-18 15:18:32 EDT LOG: shutting down
2013-04-18 15:18:32 EDT LOG: database system is shut down
Rendered /home/Pavilion/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms)
Rendered /home/Pavilion/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.0ms)
Rendered /home/Pavilion/.rvm/gems/ruby-1.9.3-p374/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (42.0ms)
Connecting to database specified by database.yml
Connecting to database specified by database.yml
...
Started DELETE "/users" for 127.0.0.1 at 2013-04-18 15:14:20 -0400
Processing by Devise::RegistrationsController#destroy as HTML
Parameters: {"authenticity_token"=>"xxxxx="}
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 57 LIMIT 1
[1m[36m (0.0ms)[0m [1mBEGIN[0m
[1m[35mSQL (1.0ms)[0m DELETE FROM "users" WHERE "users"."id" = $1 [["id", 57]]
Errno::EBADF: Bad file descriptor - rb_thread_select(): DELETE FROM "users" WHERE "users"."id" = $1
[1m[36m (0.0ms)[0m [1mROLLBACK[0m
Completed 500 Internal Server Error in 5ms
ActiveRecord::StatementInvalid (Errno::EBADF: Bad file descriptor - rb_thread_select(): DELETE FROM "users" WHERE "users"."id" = $1):
activerecord (3.2.11) lib/active_record/connection_adapters/postgresql_adapter.rb:1165:in `block'
activerecord (3.2.11) lib/active_record/connection_adapters/postgresql_adapter.rb:1165:in `exec_cache'
activerecord (3.2.11) lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `block in exec_delete'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
activerecord (3.2.11) lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_delete'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/database_statements.rb:101:in `delete'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `delete'
activerecord (3.2.11) lib/active_record/relation.rb:413:in `delete_all'
activerecord (3.2.11) lib/active_record/persistence.rb:141:in `destroy'
activerecord (3.2.11) lib/active_record/locking/optimistic.rb:103:in `destroy'
activerecord (3.2.11) lib/active_record/callbacks.rb:254:in `block in destroy'
activesupport (3.2.11) lib/active_support/callbacks.rb:403:in `_run__747758159__destroy__128269692__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
activerecord (3.2.11) lib/active_record/callbacks.rb:254:in `destroy'
activerecord (3.2.11) lib/active_record/transactions.rb:254:in `block in destroy'
activerecord (3.2.11) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
activerecord (3.2.11) lib/active_record/transactions.rb:208:in `transaction'
activerecord (3.2.11) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
activerecord (3.2.11) lib/active_record/transactions.rb:254:in `destroy'
devise (2.2.3) app/controllers/devise/registrations_controller.rb:59:in `destroy'
actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.11) lib/active_support/callbacks.rb:436:in `_run__389569436__process_action__28646103__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.11) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.11) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:36:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/mapper.rb:42:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
omniauth (1.1.3) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.3) lib/omniauth/strategy.rb:157:in `call'
meta_request (0.2.3) lib/meta_request/middlewares/app_request_handler.rb:11:in `call'
rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
meta_request (0.2.3) lib/meta_request/middlewares/headers.rb:16:in `call'
meta_request (0.2.3) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__111743413__call__128269692__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.11) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/home/Pavilion/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/home/Pavilion/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/home/Pavilion/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
...
Started POST "/users" for 127.0.0.1 at 2013-04-18 15:15:23 -0400
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxxxx=", "user"=>{"email"=>"me@example.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
[1m[36m (1.0ms)[0m [1mBEGIN[0m
[1m[35mUser Exists (0.0ms)[0m SELECT 1 AS one FROM "users" WHERE "users"."email" = 'me@example.com' LIMIT 1
[1m[36mUser Load (0.0ms)[0m [1mSELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'xxxxx' LIMIT 1[0m
[1m[35mSQL (1.0ms)[0m INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "description", "email", "encrypted_password", "first_name", "headline", "image", "industry", "last_name", "last_sign_in_at", "last_sign_in_ip", "location", "name", "nickname", "provider", "public_profile", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "uid", "unconfirmed_email", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28) RETURNING "id" [["confirmation_sent_at", Thu, 18 Apr 2013 19:15:23 UTC +00:00], ["confirmation_token", "xxxxx"], ["confirmed_at", nil], ["created_at", Thu, 18 Apr 2013 19:15:23 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["description", nil], ["email", "me@example.com"], ["encrypted_password", "xxxxx"], ["first_name", nil], ["headline", nil], ["image", nil], ["industry", nil], ["last_name", nil], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["location", nil], ["name", nil], ["nickname", nil], ["provider", nil], ["public_profile", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["sign_in_count", 0], ["uid", nil], ["unconfirmed_email", nil], ["updated_at", Thu, 18 Apr 2013 19:15:23 UTC +00:00]]
Errno::EBADF: Bad file descriptor - rb_thread_select(): INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "description", "email", "encrypted_password", "first_name", "headline", "image", "industry", "last_name", "last_sign_in_at", "last_sign_in_ip", "location", "name", "nickname", "provider", "public_profile", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "uid", "unconfirmed_email", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28) RETURNING "id"
[1m[36m (1.0ms)[0m [1mROLLBACK[0m
Completed 500 Internal Server Error in 469ms
ActiveRecord::StatementInvalid (Errno::EBADF: Bad file descriptor - rb_thread_select(): INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "description", "email", "encrypted_password", "first_name", "headline", "image", "industry", "last_name", "last_sign_in_at", "last_sign_in_ip", "location", "name", "nickname", "provider", "public_profile", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "uid", "unconfirmed_email", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28) RETURNING "id"):
...
Started DELETE "/users" for 127.0.0.1 at 2013-04-18 15:17:25 -0400
Processing by Devise::RegistrationsController#destroy as HTML
Parameters: {"authenticity_token"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="}
[1m[35mUser Load (1.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = 57 LIMIT 1
[1m[36m (3.0ms)[0m [1mBEGIN[0m
[1m[35mSQL (0.0ms)[0m DELETE FROM "users" WHERE "users"."id" = $1 [["id", 57]]
Errno::EBADF: Bad file descriptor - rb_thread_select(): DELETE FROM "users" WHERE "users"."id" = $1
[1m[36m (1.0ms)[0m [1mROLLBACK[0m
Completed 500 Internal Server Error in 7ms
ActiveRecord::StatementInvalid (Errno::EBADF: Bad file descriptor - rb_thread_select(): DELETE FROM "users" WHERE "users"."id" = $1):
最佳答案
我可以通过pgAdmin GUI或psql> mydatabase命令行直接与数据库进行交互。
那么,为什么还要摆弄数据库呢?那不是导致您出现问题的部分。
这个:
EBADF:错误的文件描述符
提示连接有问题,甚至数据库连接库本身有问题。
在PostgreSQL中打开连接日志。在应用程序中打开登录。在进一步查看之前,请确保可以连接。
关于ruby-on-rails - 从SQLite迁移后,为什么我的应用程序不能修改开发postgresql数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16068087/
前言: 有时候,一个数据库有多个帐号,包括数据库管理员,开发人员,运维支撑人员等,可能有很多帐号都有比较大的权限,例如DDL操作权限(创建,修改,删除存储过程,创建,修改,删除表等),账户多了,管理
这个问题已经有答案了: Condition variable deadlock (2 个回答) 已关闭 5 年前。 在研究多线程时,我编写了以下代码,但在屏幕上没有观察到输出。我在这里做错了什么?我期
复制代码 代码如下: <IfModule mod_rewrite.c> RewriteEngineOn RewriteBase/ #将www.zzvips.com跳转到www.zzv
复制代码 代码如下: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # 把 www.zzvips.com
复制代码 代码如下: Const T_GATEWAY = "1.1.1.1" '网关 Const T_NEWDNS1 = "2.2.2.2" 'DNS1
0. 修改索引 大文本字段支持排序 PUT http://localhost:9200/lrc_blog/_mapping //请求体 { "properties": { "title": { "t
仅 react 当状态发生变化时重新渲染 . 那么为什么我会直接看到我对真实 DOM 所做的更改呢? 我知道我正在修改真实的 DOM,但是当我根本没有改变状态时触发重新渲染的是什么。 import R
Xcode beta 5 推出 @FetchRequest对于 SwiftUI。 我有一个 View ,它有一个 @FetchRequest . NSFetchRequest是在管理器中创建的,该管理
关闭。这个问题需要更多 focused .它目前不接受答案。 想改进这个问题?更新问题,使其仅关注一个问题 editing this post . 7年前关闭。 Improve this questi
我有一个表达式[text][id]应替换为链接 text 解决方案是( id 是整数) $s = preg_replace("/\[([^\]]+)(\]*)\]\[([0-9]+)\]/","$1$
我在 repo 中有一个文件,我不想让任何人更新。 我能做什么? 最佳答案 你想要svn锁:http://www.linxit.de/svnbook/en/1.2/svn.ref.svn.c.lock
说我有项目 list 。我想导出到csv,但在此之前我想做一些计算/修改。 基本上,设置如下所示: PS C:\Files> gci Directory: C:\Files Mode
我有一个非常简单的问题 - 是否可以修改 Java API 的源代码,例如Junit,JABX ? 我知道这似乎是一个非常愚蠢的问题,但它一直困扰着我一段时间。 最佳答案 如果您可以掌握源代码,那么请
我有一个带有变量/列的小标题,其中包括不同形状的小标题列表。我想为其中一个变量中的每个(子)标题添加一个变量/列。 例如此类数据 library("tibble") aaa aaa # A tibb
我有几个菜单,可以在单击时向当前链接添加变量。这是一个例子: 1 2 3 x y z 我的问题是,如果我选择“y”2次,它会添加“&cord=y”2次。相反,我希望它替
我有两个项目:一个服务项目和一个服务安装程序项目。服务项目具有适合我的产品的装配信息。它包括公司信息和正确的服务名称。一旦服务实际安装,所有这些似乎都会被忽略。安装服务时,它使用在服务安装程序的ini
以下代码何时可能产生副作用? @some = map { s/xxx/y/; $_ } @some; perlcritic 将其解释为危险的,因为例如: @other = map { s/xxx/y/
我想知道以下哪种解决方案更好:我想修改一些 .class 文件,我意识到有两种方法可以做到这一点: 反编译.class文件,修改它,最后再次编译。 - 直接用十六进制编辑器修改。 谢谢 最佳答案 在这
这是我的按钮代码 onclick 我希望我的程序等待用户单击一个 JPanel,并且当用户单击 JPanel 时,它应该在控制台上打印其名称。 此按钮代码未显示输出 JPopupMenu popu
我正在使用一个具有“getName()”方法的特定 API。 getName() 返回一个字符串。是否可以修改该字符串? API 中不包含修饰符方法,并且 String getName() 返回的是私
我是一名优秀的程序员,十分优秀!