Ruby rails 狂欢商业抽成已中止
Ruby on rails Spree commerce rake aborted
我在 rails 的 ruby 与 spree commerce 合作。但是在执行此命令 "bundle exec rails g spree_fancy:install" 时出现错误。我做错了什么?请帮我。提前致谢。
这是我的错误:
moududhassan@moududhassan-HP-ProBook-450-G1:~/SpreeProject/banglashop$ bundle exec rails g spree_fancy:install
append vendor/assets/javascripts/spree/frontend/all.js
insert vendor/assets/stylesheets/spree/frontend/all.css
run bundle exec rake railties:install:migrations FROM=spree_fancy from "."
Would you like to run the migrations now? [Y/n] n
Skipping rake db:migrate, don't forget to run it!
moududhassan@moududhassan-HP-ProBook-450-G1:~/SpreeProject/banglashop$ bundle exec rake db:migrate
[WARNING] You are not setting Devise.secret_key within your application!
You must set this in config/initializers/devise.rb. Here's an example:
Devise.secret_key = "ccbb0e6f45b7b7e4eea82ab3f24dab317816ad6b7bf3a2cd10b0879b52bbbfb83d0b2be34cdffb19672ada6fb8aa2d91f142"
== 20150214044609 AddSliderTaxonsAndApplyThem: migrating ======================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: relation "spree_taxonomy_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxonomy_translati...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"spree_taxonomy_translations"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/home/moududhassan/SpreeProject/banglashop/db/migrate/20150214044609_add_slider_taxons_and_apply_them.spree_fancy.rb:4:in `up'
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "spree_taxonomy_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxonomy_translati...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"spree_taxonomy_translations"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/home/moududhassan/SpreeProject/banglashop/db/migrate/20150214044609_add_slider_taxons_and_apply_them.spree_fancy.rb:4:in `up'
PG::UndefinedTable: ERROR: relation "spree_taxonomy_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxonomy_translati...
^
/home/moududhassan/SpreeProject/banglashop/db/migrate/20150214044609_add_slider_taxons_and_apply_them.spree_fancy.rb:4:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我的 gem 个文件是:
gem 'rails', '4.1.8'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'spree', git: 'https://github.com/spree/spree.git', branch: '2-4-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '2-4-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-4-stable'
gem 'spree_paypal_express', github: 'spree-contrib/better_spree_paypal_express', branch: '2-4-stable'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: '2-4-stable'
gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: '2-4-stable'
gem 'spree_fancy', :github => 'spree/spree_fancy', :branch => '2-4-stable'
gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: '2-4-stable'
我的database.yml是:
default: &default
adapter: postgresql
encoding: unicode
database: hairdom_test
port: 5432
host: localhost
pool: 5
username: postgres
password: 007rajob
development:
<<: *default
database: hairdom_test
test:
<<: *default
database: hairdom_test
production:
<<: *default
database: hairdom_test
当我在本地主机中 运行 这个项目时,它显示:
您遇到的 bundle exec rails g spree_fancy:install
错误是因为您的 spree_i18n 迁移不是 运行 首先。您可以看出这一点,因为错误消息引用了翻译表。
您必须修复迁移尝试 运行 的顺序,以便 spree_i18n 的 运行 在其他人之前,或者可以尝试评论 spree_i18n 在你 运行 你的迁移之前离开 Gemfile。
您在访问 localhost:3000 时看到的错误消息是一个挂起的迁移错误,正如它所说,您需要 运行 rake db:migrate
到 运行 它们。根据您的情况,您可能还需要 rake railties:install:migrations
在 运行 宁 rake db:migrate
之前确保我们将所有扩展迁移复制到您的应用程序。
我在 rails 的 ruby 与 spree commerce 合作。但是在执行此命令 "bundle exec rails g spree_fancy:install" 时出现错误。我做错了什么?请帮我。提前致谢。
这是我的错误:
moududhassan@moududhassan-HP-ProBook-450-G1:~/SpreeProject/banglashop$ bundle exec rails g spree_fancy:install
append vendor/assets/javascripts/spree/frontend/all.js
insert vendor/assets/stylesheets/spree/frontend/all.css
run bundle exec rake railties:install:migrations FROM=spree_fancy from "."
Would you like to run the migrations now? [Y/n] n
Skipping rake db:migrate, don't forget to run it!
moududhassan@moududhassan-HP-ProBook-450-G1:~/SpreeProject/banglashop$ bundle exec rake db:migrate
[WARNING] You are not setting Devise.secret_key within your application!
You must set this in config/initializers/devise.rb. Here's an example:
Devise.secret_key = "ccbb0e6f45b7b7e4eea82ab3f24dab317816ad6b7bf3a2cd10b0879b52bbbfb83d0b2be34cdffb19672ada6fb8aa2d91f142"
== 20150214044609 AddSliderTaxonsAndApplyThem: migrating ======================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: relation "spree_taxonomy_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxonomy_translati...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"spree_taxonomy_translations"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/home/moududhassan/SpreeProject/banglashop/db/migrate/20150214044609_add_slider_taxons_and_apply_them.spree_fancy.rb:4:in `up'
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "spree_taxonomy_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxonomy_translati...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"spree_taxonomy_translations"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
/home/moududhassan/SpreeProject/banglashop/db/migrate/20150214044609_add_slider_taxons_and_apply_them.spree_fancy.rb:4:in `up'
PG::UndefinedTable: ERROR: relation "spree_taxonomy_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxonomy_translati...
^
/home/moududhassan/SpreeProject/banglashop/db/migrate/20150214044609_add_slider_taxons_and_apply_them.spree_fancy.rb:4:in `up'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我的 gem 个文件是:
gem 'rails', '4.1.8'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'spree', git: 'https://github.com/spree/spree.git', branch: '2-4-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '2-4-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-4-stable'
gem 'spree_paypal_express', github: 'spree-contrib/better_spree_paypal_express', branch: '2-4-stable'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: '2-4-stable'
gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: '2-4-stable'
gem 'spree_fancy', :github => 'spree/spree_fancy', :branch => '2-4-stable'
gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings', branch: '2-4-stable'
我的database.yml是:
default: &default
adapter: postgresql
encoding: unicode
database: hairdom_test
port: 5432
host: localhost
pool: 5
username: postgres
password: 007rajob
development:
<<: *default
database: hairdom_test
test:
<<: *default
database: hairdom_test
production:
<<: *default
database: hairdom_test
当我在本地主机中 运行 这个项目时,它显示:
您遇到的 bundle exec rails g spree_fancy:install
错误是因为您的 spree_i18n 迁移不是 运行 首先。您可以看出这一点,因为错误消息引用了翻译表。
您必须修复迁移尝试 运行 的顺序,以便 spree_i18n 的 运行 在其他人之前,或者可以尝试评论 spree_i18n 在你 运行 你的迁移之前离开 Gemfile。
您在访问 localhost:3000 时看到的错误消息是一个挂起的迁移错误,正如它所说,您需要 运行 rake db:migrate
到 运行 它们。根据您的情况,您可能还需要 rake railties:install:migrations
在 运行 宁 rake db:migrate
之前确保我们将所有扩展迁移复制到您的应用程序。