Closed bbuchalter closed 7 years ago
I'm attempting to write a new Solidus extension but cannot get the dummy app to run database migrations via the common:test_app Rake task. The migration works as expected when run directly from spec/dummy.
common:test_app
spec/dummy
chruby 2.3 gem install bundler git clone https://github.com/bbuchalter/solidus_production_logs.git cd solidus_production_logs ./bin/setup bundle exec rake
# After executing steps to reproduce bundle exec rake railties:install:migrations bundle exec rake db:migrate VERBOSE=false
Expected database migrations to run after dummy Solidus app was created.
Generating dummy Rails application... Setting up dummy database... bundle exec rake db:migrate VERBOSE=false rake aborted! NameError: uninitialized constant Spree /Users/brian/workspace/solidus_production_logs/spec/dummy/config/initializers/spree.rb:4:in `<top (required)>' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/engine.rb:652:in `block in load_config_initializer' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/activesupport-4.2.8/lib/active_support/notifications.rb:166:in `instrument' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/engine.rb:651:in `load_config_initializer' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/engine.rb:615:in `each' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/engine.rb:615:in `block in <class:Engine>' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `instance_exec' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `run' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/initializable.rb:55:in `block in run_initializers' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/initializable.rb:54:in `run_initializers' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/application.rb:352:in `initialize!' /Users/brian/workspace/solidus_production_logs/spec/dummy/config/environment.rb:5:in `<top (required)>' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/application.rb:328:in `require' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/application.rb:328:in `require_environment!' /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/railties-4.2.8/lib/rails/application.rb:457:in `block in run_tasks_blocks' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>' /Users/brian/.gem/ruby/2.3.3/bin/bundle:22:in `load' /Users/brian/.gem/ruby/2.3.3/bin/bundle:22:in `<main>' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace) rake aborted! Command failed with status (1): [bundle exec rake db:migrate VERBOSE=false...] /Users/brian/workspace/solidus_production_logs/vendor/bundle/gems/solidus_core-1.4.0/lib/spree/testing_support/common_rake.rb:20:in `block (2 levels) in <top (required)>' /Users/brian/workspace/solidus_production_logs/Rakefile:20:in `block in <top (required)>' /Users/brian/workspace/solidus_production_logs/Rakefile:11:in `block in <top (required)>' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors' /Users/brian/.gem/ruby/2.3.3/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>' /Users/brian/.gem/ruby/2.3.3/bin/bundle:22:in `load' /Users/brian/.gem/ruby/2.3.3/bin/bundle:22:in `<main>' Tasks: TOP => common:test_app (See full trace by running task with --trace)
Solidus Version: 1.4.0
1.4.0
Extensions in use: none
I was able to take a different approach to creating an extension.
I'm attempting to write a new Solidus extension but cannot get the dummy app to run database migrations via the
common:test_app
Rake task. The migration works as expected when run directly fromspec/dummy
.Steps to reproduce
Steps to workaround
Expected behavior
Expected database migrations to run after dummy Solidus app was created.
Actual behavior
System configuration
Solidus Version:
1.4.0
Extensions in use: none