ich dieses Problem hatte eine Rails 4.0.x App mysql 5.7.x. läuft Ich konnte es beheben, indem ich auf Schienen 4.2.x aufrüstete und meine Edelsteine aufwertete.
(Ich bin sicher, dass diese gemfiles Arbeit benötigen, aber hoffentlich sind sie immer noch nützlich)
Old Gemfile
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.13'
gem 'mysql2'
# Use unicorn as the app server
# gem 'unicorn'
gem 'sidekiq'
gem 'sinatra'
gem 'whenever'
gem 'thin'
gem 'faye'
gem 'faye-websocket'
#pdf generation
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
# Assets
gem 'backbone-on-rails', '~> 0.9.9'
gem 'coffee-rails', '~> 4.0.1'
gem 'coffee-script-source', '=1.8.0'
gem 'ejs' # uses templates for backbone
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'neat'
gem 'sass-rails', '~> 4.0.3'
gem 'therubyracer'
gem 'turbolinks'
gem 'uglifier', '>= 1.3.0'
gem 'active_model_serializers', '0.8.3'
gem 'acts_as_list'
gem 'bcrypt-ruby', '~> 3.1.2'
gem 'bootstrap-sass', '~> 3.2.0.0'
gem 'bower-rails'
gem 'carrierwave'
gem 'enumerize'
gem 'embedly' # Url to Attachment Processing
gem 'fancybox2-rails', '~> 0.2.4'
gem 'flamegraph'
gem 'fog' # s3 storage
gem 'globalize' # I18n for tagging, etc.
gem 'globalize-accessors'
gem 'i18n-tasks', '~> 0.8.3'
gem 'hirb'
gem 'kaminari'
gem 'nokogiri'
gem 'newrelic_rpm'
gem 'select2-rails' # Token Fields
gem 'twilio-ruby'
gem 'rails_autolink' # Convert urls to links
gem 'redis', '3.2.1'
gem 'rest-client'
gem 'rmagick'
gem 'rubyzip', :require => 'zip' # Zip files together
gem 'unf'
gem 'mailgun-ruby', '~>1.0.3', require: 'mailgun'
# Deployments
gem 'mina'
group :doc do
gem 'sdoc'
end
group :test do
gem 'rspec-rails', "= 2.14.2"
gem 'shoulda-matchers', :require => false
gem 'simplecov', '~> 0.9.2'
gem 'database_cleaner'
gem 'codeclimate-test-reporter', require: nil
end
group :development, :test do
gem 'quiet_assets'
gem 'factory_girl_rails', "~> 4.0"
gem 'guard', '>=2.1.0'
gem 'guard-rspec', '= 4.2.9'
gem 'spring', '1.3.6'
gem 'spring-commands-rspec'
gem 'foreman'
end
New Gemfile
source 'https://rubygems.org'
ruby '2.3.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
gem 'mysql2'
gem 'stackprof'
# Use unicorn as the app server
# gem 'unicorn'
gem 'sidekiq'
gem 'sinatra'
gem 'whenever'
gem 'thin'
gem 'faye'
gem 'faye-websocket'
#pdf generation
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
# Assets
gem 'backbone-on-rails', '~> 0.9.9'
gem 'coffee-rails', '~> 4.0.1'
gem 'coffee-script-source', '=1.8.0'
gem 'ejs' # uses templates for backbone
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'neat'
gem 'sass-rails', '~> 4.0.3'
gem 'therubyracer'
gem 'turbolinks'
gem 'uglifier', '>= 1.3.0'
gem 'active_model_serializers', '0.8.3'
gem 'acts_as_list'
gem 'bcrypt', '~> 3.1.2'
gem 'bootstrap-sass', '~> 3.2.0.0'
gem 'bower-rails'
gem 'carrierwave'
gem 'enumerize'
gem 'embedly' # Url to Attachment Processing
gem 'fancybox2-rails', '~> 0.2.4'
gem 'flamegraph'
gem 'fog' # s3 storage
gem 'globalize' # I18n for tagging, etc.
gem 'globalize-accessors'
gem 'i18n-tasks', '~> 0.8.3'
gem 'hirb'
gem 'kaminari'
gem 'nokogiri'
gem 'newrelic_rpm'
gem 'select2-rails' # Token Fields
gem 'twilio-ruby'
gem 'rails_autolink' # Convert urls to links
gem 'redis', '3.2.1'
gem 'rest-client'
gem 'rmagick'
gem 'rubyzip', :require => 'zip' # Zip files together
gem 'unf'
gem 'mailgun-ruby', '~>1.0.3', require: 'mailgun'
gem 'rack-cors', :require => 'rack/cors'
# Deployments
gem 'mina'
group :doc do
gem 'sdoc'
end
group :test do
gem 'rspec-rails', "= 2.14.2"
gem 'shoulda-matchers', :require => false
gem 'simplecov', '~> 0.9.2'
gem 'database_cleaner'
gem 'codeclimate-test-reporter', require: nil
end
group :development, :test do
gem 'quiet_assets'
gem 'factory_girl_rails', "~> 4.0"
gem 'guard', '>=2.1.0'
gem 'guard-rspec', '= 4.2.9'
gem 'spring', '1.6.1'
gem 'spring-commands-rspec'
gem 'foreman'
end
Bitte senden Sie den Code Ihrer Migration. Klingt so, als ob Sie vielleicht Composite PK haben, die Nullen erlaubt. –
habe ich nicht hinzugefügt, weil ich dort nichts komisches sehe. Ich füge es jedoch der Frage –
hinzu. Was ist deine MySQL-Version? Es sieht aus wie eine sehr aktuelle Version Konflikte mit einer älteren Rails-Version: https://github.com/rails/rails/pull/13247 Können Sie Rails aktualisieren? –