Rails 4.1.8无法转储模式,因为default_string未定义

时间:2014-12-31 15:34:44

标签: ruby-on-rails-4

我正在将rails项目从rails 3.0升级到4.1.8。我刚刚完成了自升级以来的第一次迁移,在运行它之后,schema.rb中缺少一些表,并显示以下消息。

由于跟随NoMethodError

,无法转储表“帐户”

#ActiveRecord :: SchemaDumper的未定义方法`default_string':0x007fcf024c7b00>

缺少的表都有默认值的列。

我在这里报告了类似的问题

https://github.com/rails/rails/issues/11995

在这里

https://github.com/rsim/oracle-enhanced/issues/221

但我的项目在gem或数据库方面与这些不匹配。

我在rails 4.1.8下创建了一个新项目,创建了一个迁移来创建一个无法转储的表,在MySQL数据库中运行成功并生成带有默认值的模式文件。

有没有人遇到过类似的问题?有什么建议吗?

Gemfile.lock工作时:

  specs:
actionmailer (4.1.8)
  actionpack (= 4.1.8)
  actionview (= 4.1.8)
  mail (~> 2.5, >= 2.5.4)
actionpack (4.1.8)
  actionview (= 4.1.8)
  activesupport (= 4.1.8)
  rack (~> 1.5.2)
  rack-test (~> 0.6.2)
actionview (4.1.8)
  activesupport (= 4.1.8)
  builder (~> 3.1)
  erubis (~> 2.7.0)
activemodel (4.1.8)
  activesupport (= 4.1.8)
  builder (~> 3.1)
activerecord (4.1.8)
  activemodel (= 4.1.8)
  activesupport (= 4.1.8)
  arel (~> 5.0.0)
activesupport (4.1.8)
  i18n (~> 0.6, >= 0.6.9)
  json (~> 1.7, >= 1.7.7)
  minitest (~> 5.1)
  thread_safe (~> 0.1)
  tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
builder (3.2.2)
coffee-rails (4.0.1)
  coffee-script (>= 2.2.0)
  railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
  coffee-script-source
  execjs
coffee-script-source (1.8.0)
erubis (2.7.0)
execjs (2.2.2)
formtastic (3.1.2)
  actionpack (>= 3.2.13)
hike (1.2.3)
i18n (0.6.11)
jbuilder (2.2.5)
  activesupport (>= 3.0.0, < 5)
  multi_json (~> 1.2)
jquery-rails (3.1.2)
  railties (>= 3.0, < 5.0)
  thor (>= 0.14, < 2.0)
json (1.8.1)
mail (2.6.3)
  mime-types (>= 1.16, < 3)
mime-types (2.4.3)
minitest (5.4.3)
multi_json (1.10.1)
mysql2 (0.3.17)
rack (1.5.2)
rack-test (0.6.2)
  rack (>= 1.0)
rails (4.1.8)
  actionmailer (= 4.1.8)
  actionpack (= 4.1.8)
  actionview (= 4.1.8)
  activemodel (= 4.1.8)
  activerecord (= 4.1.8)
  activesupport (= 4.1.8)
  bundler (>= 1.3.0, < 2.0)
  railties (= 4.1.8)
  sprockets-rails (~> 2.0)
railties (4.1.8)
  actionpack (= 4.1.8)
  activesupport (= 4.1.8)
  rake (>= 0.8.7)
  thor (>= 0.18.1, < 2.0)
rake (10.4.2)
rdoc (4.1.2)
  json (~> 1.4)
sass (3.2.19)
sass-rails (4.0.5)
  railties (>= 4.0.0, < 5.0)
  sass (~> 3.2.2)
  sprockets (~> 2.8, < 3.0)
  sprockets-rails (~> 2.0)
sdoc (0.4.1)
  json (~> 1.7, >= 1.7.7)
  rdoc (~> 4.0)
spring (1.2.0)
sprockets (2.12.3)
  hike (~> 1.2)
  multi_json (~> 1.0)
  rack (~> 1.0)
  tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.2.2)
  actionpack (>= 3.0)
  activesupport (>= 3.0)
  sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.10)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
turbolinks (2.5.2)
  coffee-rails
tzinfo (1.2.2)
  thread_safe (~> 0.1)
uglifier (2.5.3)
  execjs (>= 0.3.0)
  json (>= 1.8.0)

Gemfile.lock,当它没有:

 specs:
actionmailer (4.1.8)
  actionpack (= 4.1.8)
  actionview (= 4.1.8)
  mail (~> 2.5, >= 2.5.4)
actionpack (4.1.8)
  actionview (= 4.1.8)
  activesupport (= 4.1.8)
  rack (~> 1.5.2)
  rack-test (~> 0.6.2)
actionview (4.1.8)
  activesupport (= 4.1.8)
  builder (~> 3.1)
  erubis (~> 2.7.0)
active_utils (2.2.3)
  activesupport (>= 2.3.11)
  i18n
activemerchant (1.45.0)
  active_utils (~> 2.2.0)
  activesupport (>= 3.2.14, < 5.0.0)
  builder (>= 2.1.2, < 4.0.0)
  i18n (>= 0.6.9)
  json (~> 1.7)
  nokogiri (~> 1.4)
  offsite_payments (~> 2.0.0)
activemodel (4.1.8)
  activesupport (= 4.1.8)
  builder (~> 3.1)
activerecord (4.1.8)
  activemodel (= 4.1.8)
  activesupport (= 4.1.8)
  arel (~> 5.0.0)
activeresource (4.0.0)
  activemodel (~> 4.0)
  activesupport (~> 4.0)
  rails-observers (~> 0.1.1)
activesupport (4.1.8)
  i18n (~> 0.6, >= 0.6.9)
  json (~> 1.7, >= 1.7.7)
  minitest (~> 5.1)
  thread_safe (~> 0.1)
  tzinfo (~> 1.1)
addressable (2.3.6)
airbrake (4.1.0)
  builder
  multi_json
arel (5.0.1.20140414130214)
authlogic (3.4.3)
  activerecord (>= 3.2)
  activesupport (>= 3.2)
  request_store (~> 1.0)
  scrypt (~> 1.2)
awesome_print (1.2.0)
aws-sdk (1.59.1)
  aws-sdk-v1 (= 1.59.1)
aws-sdk-v1 (1.59.1)
  json (~> 1.4)
  nokogiri (>= 1.4.4)
axlsx (2.0.1)
  htmlentities (~> 4.3.1)
  nokogiri (>= 1.4.1)
  rubyzip (~> 1.0.0)
braintree (2.37.0)
  builder (>= 2.0.0)
builder (3.2.2)
cancan (1.6.10)
capybara (2.4.4)
  mime-types (>= 1.16)
  nokogiri (>= 1.3.3)
  rack (>= 1.0.0)
  rack-test (>= 0.5.4)
  xpath (~> 2.0)
chargify_api_ares (1.3.0)
  activeresource (>= 3.2.16)
childprocess (0.5.5)
  ffi (~> 1.0, >= 1.0.11)
climate_control (0.0.3)
  activesupport (>= 3.0)
cobravsmongoose (0.0.2)
cocaine (0.5.4)
  climate_control (>= 0.0.3, < 1.0)
coffee-rails (4.0.1)
  coffee-script (>= 2.2.0)
  railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
  coffee-script-source
  execjs
coffee-script-source (1.8.0)
crack (0.4.2)
  safe_yaml (~> 1.0.0)
crass (0.2.1)
cucumber (1.3.17)
  builder (>= 2.1.2)
  diff-lcs (>= 1.1.3)
  gherkin (~> 2.12)
  multi_json (>= 1.7.5, < 2.0)
  multi_test (>= 0.1.1)
cucumber-rails (1.4.2)
  capybara (>= 1.1.2, < 3)
  cucumber (>= 1.3.8, < 2)
  mime-types (>= 1.16, < 3)
  nokogiri (~> 1.5)
  rails (>= 3, < 5)
daemons (1.1.9)
database_cleaner (1.3.0)
diff-lcs (1.2.5)
doc_raptor (0.3.2)
  httparty (>= 0.7.0)
domain_name (0.5.22)
  unf (>= 0.0.5, < 1.0.0)
engineyard (3.0.1)
  engineyard-cloud-client (~> 2.1.1)
  engineyard-serverside-adapter (= 2.2.0)
  escape (~> 0.0.4)
  highline (~> 1.6.1)
  launchy (~> 2.1)
  net-ssh (~> 2.7)
engineyard-cloud-client (2.1.1)
  multi_json (~> 1.6)
  rest-client (~> 1.7)
engineyard-serverside-adapter (2.2.0)
  escape (~> 0.0.4)
  multi_json (~> 1.6)
erector (0.10.0)
  treetop (>= 1.2.3)
erubis (2.7.0)
escape (0.0.4)
eventmachine (1.0.3)
execjs (2.2.2)
factory_girl (4.5.0)
  activesupport (>= 3.0.0)
factory_girl_rails (4.5.0)
  factory_girl (~> 4.5.0)
  railties (>= 3.0.0)
ffaker (1.25.0)
ffi (1.9.6)
ffi-compiler (0.1.3)
  ffi (>= 1.0.0)
  rake
formtastic (3.1.2)
  actionpack (>= 3.2.13)
fuubar (2.0.0)
  rspec (~> 3.0)
  ruby-progressbar (~> 1.4)
fuubar-cucumber (0.0.22)
  cucumber (~> 1.3.0)
  ruby-progressbar (~> 1.2)
gherkin (2.12.2)
  multi_json (~> 1.3)
gibbon (1.1.4)
  httparty
  multi_json (>= 1.3.4)
googlecharts (1.6.8)
haml (4.0.6)
  tilt
hashie (3.3.1)
highline (1.6.21)
hike (1.2.3)
htmlentities (4.3.2)
http-cookie (1.0.2)
  domain_name (~> 0.5)
http_logger (0.5.1)
httparty (0.13.3)
  json (~> 1.8)
  multi_xml (>= 0.5.2)
i18n (0.6.11)
jbuilder (2.2.5)
  activesupport (>= 3.0.0, < 5)
  multi_json (~> 1.2)
jquery-datatables-rails (3.1.1)
  actionpack (>= 3.1)
  jquery-rails
  railties (>= 3.1)
  sass-rails
jquery-minicolors-rails (2.1.4.0)
  jquery-rails
  rails (>= 3.2.8)
jquery-rails (3.1.2)
  railties (>= 3.0, < 5.0)
  thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.3)
  railties (>= 3.2.16)
json (1.8.1)
json_spec (1.1.4)
  multi_json (~> 1.0)
  rspec (>= 2.0, < 4.0)
launchy (2.4.3)
  addressable (~> 2.3)
livequery-rails (0.0.1)
  railties (>= 3.0)
mail (2.6.3)
  mime-types (>= 1.16, < 3)
mechanize (2.7.3)
  domain_name (~> 0.5, >= 0.5.1)
  http-cookie (~> 1.0)
  mime-types (~> 2.0)
  net-http-digest_auth (~> 1.1, >= 1.1.1)
  net-http-persistent (~> 2.5, >= 2.5.2)
  nokogiri (~> 1.4)
  ntlm-http (~> 0.1, >= 0.1.1)
  webrobots (>= 0.0.9, < 0.2)
metaclass (0.0.4)
mime-types (2.4.3)
mini_portile (0.6.1)
minitest (5.4.3)
mocha (1.1.0)
  metaclass (~> 0.0.1)
money (6.4.0)
  i18n (>= 0.6.4, <= 0.7.0.beta1)
mono_logger (1.1.0)
multi_json (1.10.1)
multi_test (0.1.1)
multi_xml (0.5.5)
mysql2 (0.3.17)
net-http-digest_auth (1.4)
net-http-persistent (2.9.4)
net-ssh (2.9.1)
netrc (0.9.0)
nokogiri (1.6.5)
  mini_portile (~> 0.6.0)
nokogumbo (1.1.12)
  nokogiri
ntlm-http (0.1.1)
offsite_payments (2.0.1)
  active_utils (~> 2.2.0)
  activesupport (>= 3.2.14, < 5.0.0)
  builder (>= 2.1.2, < 4.0.0)
  i18n (~> 0.5)
  json (~> 1.7)
  money (< 7.0.0)
  nokogiri (~> 1.4)
orderedhash (0.0.6)
paperclip (4.2.0)
  activemodel (>= 3.0.0)
  activesupport (>= 3.0.0)
  cocaine (~> 0.5.3)
  mime-types
paranoia (2.0.4)
  activerecord (~> 4.0)
polyglot (0.3.5)
rack (1.5.2)
rack-protection (1.5.3)
  rack
rack-test (0.6.2)
  rack (>= 1.0)
rails (4.1.8)
  actionmailer (= 4.1.8)
  actionpack (= 4.1.8)
  actionview (= 4.1.8)
  activemodel (= 4.1.8)
  activerecord (= 4.1.8)
  activesupport (= 4.1.8)
  bundler (>= 1.3.0, < 2.0)
  railties (= 4.1.8)
  sprockets-rails (~> 2.0)
rails-observers (0.1.2)
  activemodel (~> 4.0)
railties (4.1.8)
  actionpack (= 4.1.8)
  activesupport (= 4.1.8)
  rake (>= 0.8.7)
  thor (>= 0.18.1, < 2.0)
rake (10.4.2)
rdoc (4.1.2)
  json (~> 1.4)
redcarpet (3.2.1)
redis (3.1.0)
redis-namespace (1.5.1)
  redis (~> 3.0, >= 3.0.4)
request_store (1.1.0)
resque (1.25.2)
  mono_logger (~> 1.0)
  multi_json (~> 1.0)
  redis-namespace (~> 1.3)
  sinatra (>= 0.9.2)
  vegas (~> 0.1.2)
rest-client (1.7.2)
  mime-types (>= 1.16, < 3.0)
  netrc (~> 0.7)
right_aws (3.1.0)
  right_http_connection (>= 1.2.5)
right_http_connection (1.5.0)
rspec (3.1.0)
  rspec-core (~> 3.1.0)
  rspec-expectations (~> 3.1.0)
  rspec-mocks (~> 3.1.0)
rspec-activemodel-mocks (1.0.1)
  activemodel (>= 3.0)
  activesupport (>= 3.0)
  rspec-mocks (>= 2.99, < 4.0)
rspec-core (3.1.7)
  rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
  diff-lcs (>= 1.2.0, < 2.0)
  rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
  rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
  actionpack (>= 3.0)
  activesupport (>= 3.0)
  railties (>= 3.0)
  rspec-core (~> 3.1.0)
  rspec-expectations (~> 3.1.0)
  rspec-mocks (~> 3.1.0)
  rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rturk (2.12.1)
  erector
  nokogiri
  rest-client
ruby-ole (1.2.11.7)
ruby-progressbar (1.7.0)
rubyXL (3.0.0)
  nokogiri (>= 1.4.4)
  rubyzip (>= 1.0.0)
rubyzip (1.0.0)
safe_yaml (1.0.4)
sanitize (3.0.3)
  crass (~> 0.2.0)
  nokogiri (>= 1.4.4)
  nokogumbo (= 1.1.12)
sass (3.2.19)
sass-rails (4.0.5)
  railties (>= 4.0.0, < 5.0)
  sass (~> 3.2.2)
  sprockets (~> 2.8, < 3.0)
  sprockets-rails (~> 2.0)
scrypt (1.2.1)
  ffi-compiler (>= 0.0.2)
  rake
sdoc (0.4.1)
  json (~> 1.7, >= 1.7.7)
  rdoc (~> 4.0)
selenium-webdriver (2.44.0)
  childprocess (~> 0.5)
  multi_json (~> 1.0)
  rubyzip (~> 1.0)
  websocket (~> 1.0)
shoulda-context (1.2.1)
simple-navigation (3.13.0)
  activesupport (>= 2.3.2)
simple_xurrency (1.1.2)
  crack (>= 0.1.8)
sinatra (1.4.5)
  rack (~> 1.4)
  rack-protection (~> 1.4)
  tilt (~> 1.3, >= 1.3.4)
spreadsheet (1.0.0)
  ruby-ole (>= 1.0)
sprockets (2.12.3)
  hike (~> 1.2)
  multi_json (~> 1.0)
  rack (~> 1.0)
  tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.2.2)
  actionpack (>= 3.0)
  activesupport (>= 3.0)
  sprockets (>= 2.8, < 4.0)
symbolize (4.5.1)
  activemodel (>= 3.2, < 5)
  activesupport (>= 3.2, < 5)
thin (1.6.3)
  daemons (~> 1.0, >= 1.0.9)
  eventmachine (~> 1.0)
  rack (~> 1.0)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
transitions (0.1.13)
treetop (1.5.3)
  polyglot (~> 0.3)
turbolinks (2.5.2)
  coffee-rails
tzinfo (1.2.2)
  thread_safe (~> 0.1)
uglifier (2.5.3)
  execjs (>= 0.3.0)
  json (>= 1.8.0)
unf (0.1.4)
  unf_ext
unf_ext (0.0.6)
uuidtools (2.1.5)
vegas (0.1.11)
  rack (>= 1.0.0)
webmock (1.20.4)
  addressable (>= 2.3.6)
  crack (>= 0.3.2)
webrobots (0.1.1)
websocket (1.2.1)
will_paginate (3.0.7)
writeexcel (1.0.4)
xpath (2.0.0)
  nokogiri (~> 1.3)

我正在通过恢复旧的模式文件并手动编辑它来解决问题,但显然这并不理想。

1 个答案:

答案 0 :(得分:0)

这两者之间存在巨大的差异,有很多潜在的候选人。我建议的第一件事就是尝试对所有宝石进行全面升级,保持手指交叉以修复错误,然后从有效的Gemfile开始,逐个添加每个宝石。一个找到罪魁祸首。

我会从paranoiaauthlogic开始,因为它们各自都有activerecord依赖关系,这使得它们更有可能成为问题宝石。