Thoughts on Rails 6?
buffpojken opened this issue ยท 10 comments
Rails 6 is now in rc1 - are there any thoughts on adding support?
We are working on our first Rails 6 app internally and support for it in Fae.
thanks
@jamesmk any update on this?
I added fae to a rails 6 rc1 app a couple months ago that has been in heavy development, so far no issues. Going to update to the 6.0 release soon and see how things go, will keep you posted.
cool, thx!
Any eta on rails 6 support?
Just trying out a demo (and using Rails 6), I had to add config.autoloader = :classic
to config/application.rb
to get rails g fae:install
to work move forward.
The database migrations fail:
StandardError: An error has occurred, this and all later migrations canceled:
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class AddUserTable < ActiveRecord::Migration[4.2]
/Users/jjohnson10/personal/fae_cms_demo/db/migrate/20191110194318_add_user_table.fae.rb:2:in `<main>'
Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class AddUserTable < ActiveRecord::Migration[4.2]
/Users/jjohnson10/personal/fae_cms_demo/db/migrate/20191110194318_add_user_table.fae.rb:2:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
rake fae:seed_db
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "fae_roles" does not exist
LINE 1: DELETE FROM "fae_roles" WHERE "fae_roles"."id" IN (SELECT "f...
^
/Users/jjohnson10/personal/fae_cms_demo/lib/tasks/fae_tasks.rake:4:in `block (2 levels) in <main>'
Caused by:
PG::UndefinedTable: ERROR: relation "fae_roles" does not exist
LINE 1: DELETE FROM "fae_roles" WHERE "fae_roles"."id" IN (SELECT "f...
Any update on rails 6 support
To fix it for Rails 6:
You can find more info on what happens behind the scene with fae:install
refer to this document:
https://github.com/wearefine/fae/blob/master/docs/installation/index.md
To fix this we're going to do some manual updates.
1. Update all the migrations files Fae generates
All the migration should inherit from ActiveRecord::Migration[6.0]
instead of ActiveRecord::Migration
For example:
class CreateFaeRoles < ActiveRecord::Migration[6.0]
2. Run the migration
rake db:migrate
3. run Fae seed
rake fae:seed_db RAILS_ENV=<your_env>
4. Update manifest.js
Add //= link fae/application.css
to your manifest
5. Tell rails to precompile fae/application.js
Add the following line to assets.rb
Rails.application.config.assets.precompile += %w( fae/application.js)
๐ that should work
To fix it for Rails 6:
You can find more info on what happens behind the scene with
fae:install
refer to this document:
https://github.com/wearefine/fae/blob/master/docs/installation/index.md
To fix this we're going to do some manual updates.
1. Update all the migrations files Fae generates
All the migration should inherit from
ActiveRecord::Migration[6.0]
instead ofActiveRecord::Migration
For example:
class CreateFaeRoles < ActiveRecord::Migration[6.0]
2. Run the migration
rake db:migrate
3. run Fae seed
rake fae:seed_db RAILS_ENV=<your_env>
4. Update manifest.js
Add
//= link fae/application.css
to your manifest5. Tell rails to precompile fae/application.js
Add the following line to assets.rb
Rails.application.config.assets.precompile += %w( fae/application.js)
that should work
I try add just the line 4, but doesn't work. So I just add //= link fae/application.js
below the line 4 and works to me.
If anybody had the same problem, this is the solution.
I apologize for the lack of official Rails 6 support and appreciate the work arounds. Fae 3.0 is in active development current which will support Rails 7. We expect a release by end of year.