狂欢管理面板不工作
我已经安装了 Spree gem 并按照入门中所述运行它。一切正常,但如果我想进入管理面板中的“产品”部分,则会出现以下错误:
Mysql2::Error: Unknown column 'variants.position' in 'order clause': SELECT `variants`.* FROM `variants` WHERE (`variants`.product_id IN (706676762,569012001,723959550,1025786064,1060500592,248786582,187438981,1035865702,459084718) AND (variants.is_master = 0 AND variants.deleted_at IS NULL)) ORDER BY variants.position ASC
有人遇到过这种情况吗?
编辑:这是我的 Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.7'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '~> 0.2.11'
gem 'heroku'
gem 'thin'
gem 'spree', '~> 0.60.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
gem "test", :path => "test", :require => "test"
I've install Spree gem and run it as it wrote in Getting Started. All works fine but if I want to go in the Products section in admin panel I have the following error:
Mysql2::Error: Unknown column 'variants.position' in 'order clause': SELECT `variants`.* FROM `variants` WHERE (`variants`.product_id IN (706676762,569012001,723959550,1025786064,1060500592,248786582,187438981,1035865702,459084718) AND (variants.is_master = 0 AND variants.deleted_at IS NULL)) ORDER BY variants.position ASC
Anyone faced that?
EDIT: Here is my Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.7'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '~> 0.2.11'
gem 'heroku'
gem 'thin'
gem 'spree', '~> 0.60.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
gem "test", :path => "test", :require => "test"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,当您按照这些步骤安装 spree 时,您应该在 db/migrate 中有一些迁移文件,其中之一包含您的应用程序缺少的列:
Normally when you install spree by following these steps, you should have some migration files inside db/migrate, one of them contain the missing column for your application :