Ruby on rails MongoId未更新模型数据,也未显示任何错误

Ruby on rails MongoId未更新模型数据,也未显示任何错误,ruby-on-rails,mongodb,activerecord,mongoid,Ruby On Rails,Mongodb,Activerecord,Mongoid,我有两个系统使用mongo版本3.4.16在AWS平台上工作。目前,我将它们移动到了GCP,因此,我使用了更新的mongo版本4.2.8。 首先要记住的是,在我更换服务器之前,这些系统已经运行了很多年。两者都使用相同的mongo服务器,也使用相同的集合和凭据。问题是: 有问题的系统能够在MongoDB上查询和创建数据,但不能更新任何模型的任何属性。我尝试使用同样在rails控制台上运行的web界面来更新运行该应用程序的属性,但它也存在同样的问题。除了mongo版本,我没有改变任何东西 :023

我有两个系统使用mongo版本3.4.16在AWS平台上工作。目前,我将它们移动到了GCP,因此,我使用了更新的mongo版本4.2.8。 首先要记住的是,在我更换服务器之前,这些系统已经运行了很多年。两者都使用相同的mongo服务器,也使用相同的集合和凭据。问题是:

有问题的系统能够在MongoDB上查询和创建数据,但不能更新任何模型的任何属性。我尝试使用同样在rails控制台上运行的web界面来更新运行该应用程序的属性,但它也存在同样的问题。除了mongo版本,我没有改变任何东西

:023 > user = User.where({email: 'email@test.com'}).first
:024 > user.name
 => "user name"
:025 > user.name = "new user name"
 => "new user name"
:026 > user.save!
 [paperclip] Saving attachments.
  => true
:027 > user = User.where({email: 'email@test.com'}).first
:028 > user.name
 => "user name"
第二个系统具有相同的gem版本(当我谈论mongodbgems时),并且它仍在工作(更新模型属性),甚至将mongo版本从3.4.16版本更改为4.2.8版本(正如我前面提到的)。你知道会发生什么吗

有问题的系统包括:

*** LOCAL GEMS ***

actionmailer (3.2.22.5)
actionpack (3.2.22.5)
activemodel (3.2.22.5)
activerecord (3.2.22.5)
activeresource (3.2.22.5)
activesupport (3.2.22.5)
addressable (2.5.0)
akami (1.3.1)
apipie-rails (0.3.7)
arel (3.0.3)
aws-sdk (1.66.0)
aws-sdk-v1 (1.66.0)
bcrypt (3.1.11)
better_errors (2.1.1)
bigdecimal (default: 1.2.8)
binding_of_caller (0.8.0)
bson (4.3.0, 1.12.5)
bson_ext (1.12.5)
builder (3.0.4)
bundler (default: 1.17.3)
bundler-unload (1.0.2)
capybara (2.12.0)
client_side_validations (3.2.8)
cocaine (0.3.2)
coderay (1.1.1)
coffee-rails (3.2.2)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
connection_pool (2.2.1)
cpf_cnpj (0.3.0)
credit_card_validations (3.4.0)
cucumber (2.4.0)
cucumber-core (1.5.0)
cucumber-rails (1.4.5)
cucumber-wire (0.0.1)
daemons (1.2.6)
debug_inspector (0.0.3)
devise (3.5.10)
did_you_mean (1.0.0)
diff-lcs (1.3)
domain_name (0.5.20161129)
erubis (2.7.0)
eventmachine (1.2.2)
execjs (2.7.0)
executable-hooks (1.6.0)
faraday (0.11.0)
faraday_middleware (0.11.0.1)
faye-websocket (0.10.0)
figaro (1.1.1)
gem-wrappers (1.4.0)
geocoder (1.3.3)
gherkin (4.0.0)
google-geocode (1.2.1)
google_maps_service (0.4.2)
gyoku (1.3.1)
hike (1.2.3)
hiredis (0.6.1)
hoe (3.16.0)
http-cookie (1.0.3)
httparty (0.13.3)
httpi (2.4.2)
hurley (0.2)
i18n (0.9.5)
io-console (default: 0.4.5)
journey (1.0.4)
jquery-rails (3.1.4)
json (1.8.6, default: 1.8.3)
libv8 (3.16.14.19 x86_64-linux)
mail (2.5.5)
mime-types (1.25.1)
mini_portile (0.6.2)
minitest (5.11.3, 5.8.3)
momentjs-rails (2.17.1)
mongo (2.6.2)
mongo_session_store-rails3 (6.0.0)
mongoid (3.1.7)
mongoid-geospatial (4.0.0)
mongoid-paperclip (0.0.11)
mongoid_userstamp (0.4.0)
moped (1.5.3)
multi_json (1.13.1)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
net-http-persistent (1.9)
net-telnet (0.1.1)
netrc (0.11.0)
newrelic_mongodb (0.1.2)
newrelic_rpm (3.18.1.330)
nokogiri (1.6.6.4)
nori (2.6.0)
origin (1.1.0)
orm_adapter (0.5.0)
paperclip (3.1.1)
polyglot (0.3.5)
power_assert (1.0.1, 0.2.6)
psych (default: 2.0.17)
public_suffix (2.0.5)
puma (3.12.0)
quiet_assets (1.1.0)
rack (1.4.7)
rack-cache (1.9.0)
rack-ssl (1.3.4)
rack-test (0.6.3)
rails (3.2.22.5)
railties (3.2.22.5)
rake (12.0.0, 10.4.2)
rc-rest (4.0)
rdoc (default: 4.2.1, 3.12.2)
redis (3.3.3)
redis-objects (1.2.1)
ref (2.0.0)
responders (1.1.2)
rest-client (2.0.0)
retriable (2.1.0)
rubygems-bundler (1.4.5)
rvm (1.11.3.9)
sass (3.4.23)
sass-rails (3.2.6)
savon (2.11.1)
socksify (1.7.1)
sprockets (2.2.3)
test-unit (3.2.3, 3.1.5)
therubyracer (0.12.3)
thin (1.7.2)
thor (0.19.4)
thread_safe (0.3.5)
tilt (1.4.1)
treetop (1.4.15)
tzinfo (0.3.52)
uglifier (3.0.4)
unf (0.1.4)
unf_ext (0.0.7.2)
uuidtools (2.1.5)
warden (1.2.7)
wasabi (3.5.0)
websocket-driver (0.6.5)
websocket-extensions (0.1.2)
will_paginate (3.1.5)
will_paginate_mongoid (2.0.1)
xpath (2.0.0)
*** LOCAL GEMS ***

actionmailer (3.2.22.5)
actionpack (3.2.22.5)
activemodel (3.2.22.5)
activerecord (3.2.22.5)
activeresource (3.2.22.5)
activesupport (3.2.22.5)
addressable (2.5.2, 2.5.0)
adminlte2-rails (0.0.6)
akami (1.3.1)
apipie-rails (0.3.7)
arel (3.0.3)
autoprefixer-rails (8.2.0)
aws-sdk (1.67.0, 1.66.0)
aws-sdk-v1 (1.67.0, 1.66.0)
backports (3.11.1)
bcrypt (3.1.11)
better_errors (2.4.0, 2.1.1)
bigdecimal (default: 1.2.8)
binding_of_caller (0.8.0)
bootstrap-sass (3.3.4.1)
bson (4.3.0, 1.12.5)
bson_ext (1.12.5)
builder (3.0.4)
bundler (default: 1.17.3)
bundler-unload (1.0.2)
capybara (2.18.0, 2.12.0)
chartkick (2.3.3)
client_side_validations (3.2.8)
climate_control (0.2.0)
cocaine (0.6.0, 0.3.2)
coderay (1.1.2, 1.1.1)
coffee-rails (3.2.2)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5, 1.0.5)
connection_pool (2.2.2, 2.2.1)
cpf_cnpj (0.4.1, 0.3.0)
credit_card_validations (3.5.0, 3.4.0)
cucumber (3.1.0, 2.4.0)
cucumber-core (3.1.0, 1.5.0)
cucumber-expressions (5.0.14)
cucumber-rails (1.4.5)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
daemons (1.2.6)
debug_inspector (0.0.3)
declarative (0.0.10)
declarative-option (0.1.0)
devise (3.5.10)
did_you_mean (1.0.0)
diff-lcs (1.3)
domain_name (0.5.20170404, 0.5.20161129)
dropzonejs-rails (0.8.2)
erubi (1.7.1)
erubis (2.7.0)
eventmachine (1.2.7, 1.2.2)
execjs (2.7.0)
executable-hooks (1.6.0)
faraday (0.12.2, 0.11.0)
faraday_middleware (0.12.2, 0.11.0.1)
faye-websocket (0.10.0)
fcm (0.0.2)
ffi (1.9.23)
figaro (1.1.1)
gem-wrappers (1.4.0)
geocoder (1.3.3)
gherkin (5.0.0, 4.0.0)
google-api-client (0.10.3)
google-geocode (1.2.1)
google_maps_service (0.4.2)
googleauth (0.6.2)
gyoku (1.3.1)
hike (1.2.3)
hiredis (0.6.1)
hoe (3.16.0)
http-cookie (1.0.3)
httparty (0.13.3)
httpclient (2.8.3)
httpi (2.4.3, 2.4.2)
hurley (0.2)
i18n (0.9.5)
io-console (default: 0.4.5)
journey (1.0.4)
jquery-rails (3.1.4)
jquery_mask_rails (0.1.0)
json (1.8.6, default: 1.8.3)
jwt (1.5.6)
libv8 (3.16.14.19 x86_64-linux)
little-plugger (1.1.4)
logging (2.2.2)
mail (2.5.5)
memoist (0.16.0)
mime-types (1.25.1)
mini_mime (1.0.0)
mini_portile (0.6.2)
mini_portile2 (2.3.0)
minitest (5.11.3, 5.8.3)
momentjs-rails (2.20.1, 2.17.1)
mongo (2.6.2)
mongo_session_store-rails3 (6.0.0)
mongoid (3.1.7)
mongoid-geospatial (4.0.0)
mongoid-paperclip (0.0.11)
mongoid_userstamp (0.4.0)
moped (1.5.3)
multi_json (1.13.1)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
net-http-persistent (1.9)
net-telnet (0.1.1)
netrc (0.11.0)
newrelic_mongodb (0.1.2)
newrelic_rpm (5.3.0.346, 3.18.1.330)
nokogiri (1.8.2, 1.6.6.4)
nori (2.6.0)
origin (1.1.0)
orm_adapter (0.5.0)
os (0.9.6)
pagarme (2.2.2)
pagy (3.4.1)
paperclip (3.1.1)
polyglot (0.3.5)
power_assert (1.1.1, 1.0.1, 0.2.6)
psych (default: 2.0.17)
public_suffix (3.0.2, 2.0.5)
puma (3.12.0, 3.11.3)
quiet_assets (1.1.0)
rack (1.4.7)
rack-cache (1.9.0, 1.8.0)
rack-ssl (1.3.4)
rack-test (0.6.3)
rails (3.2.22.5)
railties (3.2.22.5)
rake (12.3.1, 12.0.0, 10.4.2)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
rc-rest (4.0)
rdoc (default: 4.2.1, 3.12.2)
redis (4.0.1, 3.3.3)
redis-objects (1.4.0, 1.2.1)
ref (2.0.0)
representable (3.0.4)
responders (1.1.2)
rest-client (2.0.2, 2.0.0)
retriable (2.1.0)
rubygems-bundler (1.4.5)
rvm (1.11.3.9)
sass (3.5.6, 3.4.23)
sass-listen (4.0.0)
sass-rails (3.2.6)
savon (2.12.0, 2.11.1)
signet (0.8.1)
socksify (1.7.1)
sprockets (2.2.3)
terrapin (0.6.0)
test-unit (3.2.7, 3.2.3, 3.1.5)
therubyracer (0.12.3)
thin (1.7.2)
thor (0.20.0, 0.19.4)
thread_safe (0.3.6, 0.3.5)
tilt (1.4.1)
time_difference (0.5.0)
treetop (1.4.15)
tzinfo (0.3.54, 0.3.52)
uber (0.1.0)
uglifier (3.2.0, 3.0.4)
unf (0.1.4)
unf_ext (0.0.7.5, 0.0.7.2)
uuidtools (2.1.5)
warden (1.2.7)
wasabi (3.5.0)
websocket-driver (0.7.0, 0.6.5)
websocket-extensions (0.1.3, 0.1.2)
will_paginate (3.1.6, 3.1.5)
will_paginate_mongoid (2.0.1)
xpath (3.0.0, 2.0.0)
工作制度包括:

*** LOCAL GEMS ***

actionmailer (3.2.22.5)
actionpack (3.2.22.5)
activemodel (3.2.22.5)
activerecord (3.2.22.5)
activeresource (3.2.22.5)
activesupport (3.2.22.5)
addressable (2.5.0)
akami (1.3.1)
apipie-rails (0.3.7)
arel (3.0.3)
aws-sdk (1.66.0)
aws-sdk-v1 (1.66.0)
bcrypt (3.1.11)
better_errors (2.1.1)
bigdecimal (default: 1.2.8)
binding_of_caller (0.8.0)
bson (4.3.0, 1.12.5)
bson_ext (1.12.5)
builder (3.0.4)
bundler (default: 1.17.3)
bundler-unload (1.0.2)
capybara (2.12.0)
client_side_validations (3.2.8)
cocaine (0.3.2)
coderay (1.1.1)
coffee-rails (3.2.2)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
connection_pool (2.2.1)
cpf_cnpj (0.3.0)
credit_card_validations (3.4.0)
cucumber (2.4.0)
cucumber-core (1.5.0)
cucumber-rails (1.4.5)
cucumber-wire (0.0.1)
daemons (1.2.6)
debug_inspector (0.0.3)
devise (3.5.10)
did_you_mean (1.0.0)
diff-lcs (1.3)
domain_name (0.5.20161129)
erubis (2.7.0)
eventmachine (1.2.2)
execjs (2.7.0)
executable-hooks (1.6.0)
faraday (0.11.0)
faraday_middleware (0.11.0.1)
faye-websocket (0.10.0)
figaro (1.1.1)
gem-wrappers (1.4.0)
geocoder (1.3.3)
gherkin (4.0.0)
google-geocode (1.2.1)
google_maps_service (0.4.2)
gyoku (1.3.1)
hike (1.2.3)
hiredis (0.6.1)
hoe (3.16.0)
http-cookie (1.0.3)
httparty (0.13.3)
httpi (2.4.2)
hurley (0.2)
i18n (0.9.5)
io-console (default: 0.4.5)
journey (1.0.4)
jquery-rails (3.1.4)
json (1.8.6, default: 1.8.3)
libv8 (3.16.14.19 x86_64-linux)
mail (2.5.5)
mime-types (1.25.1)
mini_portile (0.6.2)
minitest (5.11.3, 5.8.3)
momentjs-rails (2.17.1)
mongo (2.6.2)
mongo_session_store-rails3 (6.0.0)
mongoid (3.1.7)
mongoid-geospatial (4.0.0)
mongoid-paperclip (0.0.11)
mongoid_userstamp (0.4.0)
moped (1.5.3)
multi_json (1.13.1)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
net-http-persistent (1.9)
net-telnet (0.1.1)
netrc (0.11.0)
newrelic_mongodb (0.1.2)
newrelic_rpm (3.18.1.330)
nokogiri (1.6.6.4)
nori (2.6.0)
origin (1.1.0)
orm_adapter (0.5.0)
paperclip (3.1.1)
polyglot (0.3.5)
power_assert (1.0.1, 0.2.6)
psych (default: 2.0.17)
public_suffix (2.0.5)
puma (3.12.0)
quiet_assets (1.1.0)
rack (1.4.7)
rack-cache (1.9.0)
rack-ssl (1.3.4)
rack-test (0.6.3)
rails (3.2.22.5)
railties (3.2.22.5)
rake (12.0.0, 10.4.2)
rc-rest (4.0)
rdoc (default: 4.2.1, 3.12.2)
redis (3.3.3)
redis-objects (1.2.1)
ref (2.0.0)
responders (1.1.2)
rest-client (2.0.0)
retriable (2.1.0)
rubygems-bundler (1.4.5)
rvm (1.11.3.9)
sass (3.4.23)
sass-rails (3.2.6)
savon (2.11.1)
socksify (1.7.1)
sprockets (2.2.3)
test-unit (3.2.3, 3.1.5)
therubyracer (0.12.3)
thin (1.7.2)
thor (0.19.4)
thread_safe (0.3.5)
tilt (1.4.1)
treetop (1.4.15)
tzinfo (0.3.52)
uglifier (3.0.4)
unf (0.1.4)
unf_ext (0.0.7.2)
uuidtools (2.1.5)
warden (1.2.7)
wasabi (3.5.0)
websocket-driver (0.6.5)
websocket-extensions (0.1.2)
will_paginate (3.1.5)
will_paginate_mongoid (2.0.1)
xpath (2.0.0)
*** LOCAL GEMS ***

actionmailer (3.2.22.5)
actionpack (3.2.22.5)
activemodel (3.2.22.5)
activerecord (3.2.22.5)
activeresource (3.2.22.5)
activesupport (3.2.22.5)
addressable (2.5.2, 2.5.0)
adminlte2-rails (0.0.6)
akami (1.3.1)
apipie-rails (0.3.7)
arel (3.0.3)
autoprefixer-rails (8.2.0)
aws-sdk (1.67.0, 1.66.0)
aws-sdk-v1 (1.67.0, 1.66.0)
backports (3.11.1)
bcrypt (3.1.11)
better_errors (2.4.0, 2.1.1)
bigdecimal (default: 1.2.8)
binding_of_caller (0.8.0)
bootstrap-sass (3.3.4.1)
bson (4.3.0, 1.12.5)
bson_ext (1.12.5)
builder (3.0.4)
bundler (default: 1.17.3)
bundler-unload (1.0.2)
capybara (2.18.0, 2.12.0)
chartkick (2.3.3)
client_side_validations (3.2.8)
climate_control (0.2.0)
cocaine (0.6.0, 0.3.2)
coderay (1.1.2, 1.1.1)
coffee-rails (3.2.2)
coffee-script (2.4.1)
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5, 1.0.5)
connection_pool (2.2.2, 2.2.1)
cpf_cnpj (0.4.1, 0.3.0)
credit_card_validations (3.5.0, 3.4.0)
cucumber (3.1.0, 2.4.0)
cucumber-core (3.1.0, 1.5.0)
cucumber-expressions (5.0.14)
cucumber-rails (1.4.5)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
daemons (1.2.6)
debug_inspector (0.0.3)
declarative (0.0.10)
declarative-option (0.1.0)
devise (3.5.10)
did_you_mean (1.0.0)
diff-lcs (1.3)
domain_name (0.5.20170404, 0.5.20161129)
dropzonejs-rails (0.8.2)
erubi (1.7.1)
erubis (2.7.0)
eventmachine (1.2.7, 1.2.2)
execjs (2.7.0)
executable-hooks (1.6.0)
faraday (0.12.2, 0.11.0)
faraday_middleware (0.12.2, 0.11.0.1)
faye-websocket (0.10.0)
fcm (0.0.2)
ffi (1.9.23)
figaro (1.1.1)
gem-wrappers (1.4.0)
geocoder (1.3.3)
gherkin (5.0.0, 4.0.0)
google-api-client (0.10.3)
google-geocode (1.2.1)
google_maps_service (0.4.2)
googleauth (0.6.2)
gyoku (1.3.1)
hike (1.2.3)
hiredis (0.6.1)
hoe (3.16.0)
http-cookie (1.0.3)
httparty (0.13.3)
httpclient (2.8.3)
httpi (2.4.3, 2.4.2)
hurley (0.2)
i18n (0.9.5)
io-console (default: 0.4.5)
journey (1.0.4)
jquery-rails (3.1.4)
jquery_mask_rails (0.1.0)
json (1.8.6, default: 1.8.3)
jwt (1.5.6)
libv8 (3.16.14.19 x86_64-linux)
little-plugger (1.1.4)
logging (2.2.2)
mail (2.5.5)
memoist (0.16.0)
mime-types (1.25.1)
mini_mime (1.0.0)
mini_portile (0.6.2)
mini_portile2 (2.3.0)
minitest (5.11.3, 5.8.3)
momentjs-rails (2.20.1, 2.17.1)
mongo (2.6.2)
mongo_session_store-rails3 (6.0.0)
mongoid (3.1.7)
mongoid-geospatial (4.0.0)
mongoid-paperclip (0.0.11)
mongoid_userstamp (0.4.0)
moped (1.5.3)
multi_json (1.13.1)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.0.0)
net-http-persistent (1.9)
net-telnet (0.1.1)
netrc (0.11.0)
newrelic_mongodb (0.1.2)
newrelic_rpm (5.3.0.346, 3.18.1.330)
nokogiri (1.8.2, 1.6.6.4)
nori (2.6.0)
origin (1.1.0)
orm_adapter (0.5.0)
os (0.9.6)
pagarme (2.2.2)
pagy (3.4.1)
paperclip (3.1.1)
polyglot (0.3.5)
power_assert (1.1.1, 1.0.1, 0.2.6)
psych (default: 2.0.17)
public_suffix (3.0.2, 2.0.5)
puma (3.12.0, 3.11.3)
quiet_assets (1.1.0)
rack (1.4.7)
rack-cache (1.9.0, 1.8.0)
rack-ssl (1.3.4)
rack-test (0.6.3)
rails (3.2.22.5)
railties (3.2.22.5)
rake (12.3.1, 12.0.0, 10.4.2)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
rc-rest (4.0)
rdoc (default: 4.2.1, 3.12.2)
redis (4.0.1, 3.3.3)
redis-objects (1.4.0, 1.2.1)
ref (2.0.0)
representable (3.0.4)
responders (1.1.2)
rest-client (2.0.2, 2.0.0)
retriable (2.1.0)
rubygems-bundler (1.4.5)
rvm (1.11.3.9)
sass (3.5.6, 3.4.23)
sass-listen (4.0.0)
sass-rails (3.2.6)
savon (2.12.0, 2.11.1)
signet (0.8.1)
socksify (1.7.1)
sprockets (2.2.3)
terrapin (0.6.0)
test-unit (3.2.7, 3.2.3, 3.1.5)
therubyracer (0.12.3)
thin (1.7.2)
thor (0.20.0, 0.19.4)
thread_safe (0.3.6, 0.3.5)
tilt (1.4.1)
time_difference (0.5.0)
treetop (1.4.15)
tzinfo (0.3.54, 0.3.52)
uber (0.1.0)
uglifier (3.2.0, 3.0.4)
unf (0.1.4)
unf_ext (0.0.7.5, 0.0.7.2)
uuidtools (2.1.5)
warden (1.2.7)
wasabi (3.5.0)
websocket-driver (0.7.0, 0.6.5)
websocket-extensions (0.1.3, 0.1.2)
will_paginate (3.1.6, 3.1.5)
will_paginate_mongoid (2.0.1)
xpath (3.0.0, 2.0.0)
我以前从未见过类似的情况。

用于确定/验证正在发送哪些命令以及发送到哪个数据库


通过mongo shell检查集合,在更新前后验证其内容。

感谢您的回答,但是系统目前不支持此功能,部分问题是我无法更新系统gems,因为我需要更新所有的gems以及语言功能,这是不可能的(在我问这个问题之前我已经试过了)app/models/command\uu log\u subscriber.rb:2:in`':未初始化的常量CommandLogSubscriber::Mongo(namererror),听起来像是某种依赖性问题。在任何情况下,驱动程序2.6都支持命令监视,所以它应该以某种方式工作。