ruby-on-rails – 在Rails中弹出更新后无法运行迁移
发布时间:2020-12-16 20:21:09 所属栏目:百科 来源:网络整理
导读:当我运行任何迁移时,我遇到错误: raj@notebook-pc:~/Desktop/Projects/invoicemanagement$rails g migration RemoveDescriptionOfGoodsFromInvoiceDetails description_of_goods:stringWarning: You're using Rubygems 1.8.23 with Spring. Upgrade to at l
当我运行任何迁移时,我遇到错误:
raj@notebook-pc:~/Desktop/Projects/invoicemanagement$rails g migration RemoveDescriptionOfGoodsFromInvoiceDetails description_of_goods:string Warning: You're using Rubygems 1.8.23 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance. /var/lib/gems/1.9.1/gems/bundler-1.9.0/lib/bundler/runtime.rb:34:in `block in setup': You have already activated spring 1.3.3,but your Gemfile requires spring 1.3.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError) from /var/lib/gems/1.9.1/gems/bundler-1.9.0/lib/bundler/runtime.rb:19:in `setup' ** 11 stack trace lines skipped ** from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require' 所以有一些谷歌搜索我运行捆绑更新弹簧,解决了上述错误,我可以删除/添加迁移.再次,如果我运行rake db:migrate,我得到错误: rake aborted! StandardError: An error has occurred,this and all later migrations canceled: undefined method `to_sym' for nil:NilClass/var/lib/gems/1.9.1/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/schema_definitions.rb:216:in `column' ** 33 stack trace lines skipped ** /var/lib/gems/1.9.1/gems/activerecord-4.1.4/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>' Tasks: TOP => db:migrate 请帮帮我. 解决方法
运行bundle更新和更新Spring之后,运行控制台时出现以下错误:
There is a version mismatch between the spring client and the server. You should restart the server and make sure to use the same version. CLIENT: 1.3.4,SERVER: 1.3.3 我按照this Github issue的建议,跑了: spring stop 这解决了我的问题. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |