codeforcroatia / imamopravoznati-theme

Frontend theme for Croatian Alaveteli site
http://imamopravoznati.org
MIT License
1 stars 1 forks source link

Post install script was not run - Directly inheriting from ActiveRecord::Migration is not supported. ("imamopravoznati-theme-0.39.1.6" branch) #130

Closed schlos closed 2 years ago

schlos commented 2 years ago

Describe the bug

When installing theme from "imamopravoznati-theme-0.39.1.6" branch: https://github.com/codeforcroatia/imamopravoznati-theme/tree/imamopravoznati-0.39.1.6

I get error:

Running install hook in /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme
Running post_install hook in /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme
rake aborted!
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:

  class IpzAddAddressAndDobToUser < ActiveRecord::Migration[4.2]
/home/alaveteli/bundle/ruby/2.5.0/gems/activerecord-5.2.6/lib/active_record/migration.rb:528:in `inherited'
/data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme/db/migrate/ipz_add_address_and_pin_to_user.rb:2:in `<top (required)>'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in `require'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in `block in require'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:291:in `require'
/data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme/post_install.rb:13:in `<top (required)>'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in `load'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in `block in load'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:257:in `load_dependency'
/home/alaveteli/bundle/ruby/2.5.0/gems/activesupport-5.2.6/lib/active_support/dependencies.rb:285:in `load'
/data/www/imamopravoznati.org/alaveteli/lib/tasks/themes.rake:45:in `run_hook'
/data/www/imamopravoznati.org/alaveteli/lib/tasks/themes.rake:127:in `install_theme'
/data/www/imamopravoznati.org/alaveteli/lib/tasks/themes.rake:141:in `block (3 levels) in <top (required)>'
/data/www/imamopravoznati.org/alaveteli/lib/tasks/themes.rake:140:in `each'
/data/www/imamopravoznati.org/alaveteli/lib/tasks/themes.rake:140:in `block (2 levels) in <top (required)>'
/home/alaveteli/bundle/ruby/2.5.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
Tasks: TOP => themes:install
(See full trace by running task with --trace)

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

schlos commented 2 years ago

Result after last PR:

Running post_install hook in /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme
rake aborted!
NoMethodError: undefined method `rails5?' for main:Object
Did you mean?  raise
/data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme/db/migrate/ipz_add_address_and_pin_to_user.rb:2:in `<top (required)>'
schlos commented 2 years ago

Error after last PR:

Running post_install hook in /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme
rake aborted!
NameError: uninitialized constant IpzAddAddressAndPinToUser
/data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme/post_install.rb:11:in `<top (required)>'
schlos commented 2 years ago

Fixed:

Running install hook in /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme
Running post_install hook in /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme
-- add_column(:users, :address, :string)
   -> 0.0136s
-- add_column(:users, :national_id_number, :string)
   -> 0.0034s
imamopravoznati-theme successfully installed in: /data/www/imamopravoznati.org/alaveteli/lib/themes/imamopravoznati-theme