Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font-awesome issue. Again. #3216

Closed
airled opened this issue Nov 5, 2019 · 16 comments
Closed

Font-awesome issue. Again. #3216

airled opened this issue Nov 5, 2019 · 16 comments

Comments

@airled
Copy link

airled commented Nov 5, 2019

New rails 6.0.1 with sass-rails 6.0.0 with sprockets 4 and rails_admin 2.0.0 raises this again:

Error: File to import not found or unreadable: rails_admin/font-awesome.
        on line 61:1 of ../.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rails_admin-2.0.0/app/assets/stylesheets/rails_admin/rails_admin.scss.erb
>> @import 'rails_admin/font-awesome';
CHTJonas added a commit to CHTJonas/roombooking that referenced this issue Nov 6, 2019
The current published verison of the rails_admin gem has an issue
regarding the transclusion of a stylesheet pertaining to Font Awesome.
For more information please see:
railsadminteam/rails_admin#3216

Signed-off-by: Charlie Jonas <charlie@charliejonas.co.uk>
@designium
Copy link

I have the same issue too:

SassC::SyntaxError in RailsAdmin::Main#dashboard
Showing /usr/local/var/rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rails_admin- 2.0.0/app/views/layouts/rails_admin/_head.html.haml where line #6 raised:

Error: File to import not found or unreadable: rails_admin/font-awesome.
    on line 61:1 of ../../../../../usr/local/var/rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rails_admin-2.0.0/app/assets/stylesheets/rails_admin/rails_admin.scss.erb
>> @import 'rails_admin/font-awesome';

@tuanbht
Copy link

tuanbht commented Nov 14, 2019

Same too :((

Error: File to import not found or unreadable: rails_admin/font-awesome.
on line 61:1 of ../../../.rvm/gems/ruby-2.6.5/gems/rails_admin-2.0.0/app/assets/stylesheets/rails_admin/rails_admin.scss.erb

@import 'rails_admin/font-awesome';

@airled
Copy link
Author

airled commented Nov 14, 2019

As @CHTJonas mentioned, we can use rails_admin directly from github

gem 'rails_admin', '~> 2.0', git: 'https://github.com/sferik/rails_admin.git'

instead of rubygems for now.

@designium
Copy link

@airled Thanks! Your solution works. I just didn't know I could import gem like that.

@ziaulrehman40
Copy link

Why using it like this from git directly is needed? Curious.

@airled
Copy link
Author

airled commented Dec 11, 2019

Why using it like this from git directly is needed? Curious.

Because last version on rubygems is 2.0.0 (august) and fix was merged after that time. You can use the gem from rubygems again after it will be updated on rubygems.

@ziaulrehman40
Copy link

Such patches should be released on ASAP basis though, thanks for explaining. 🙂

ha4gu added a commit to ha4gu/nepenthes-negotium-rursus that referenced this issue Dec 16, 2019
To avoid an issue related to font-awesome, currently this gem is installed from GitHub following the instruction written here: railsadminteam/rails_admin#3216
@mshibuya
Copy link
Member

Dup of #3204 and fixed in the latest release 2.0.1.

@sonianand11
Copy link

Updating Version to 2.0.2 works for me.

@nezirz
Copy link

nezirz commented Oct 21, 2022

I had issue in version 2.2.1 and tried that one above with url 2.0 but like url dont exists anymore so tried also 2.0.2 and worked. Thank you!

@Saworieza
Copy link

Saworieza commented Nov 12, 2022

Popping up again in version 3.1.0 Kindly take a look

@mshibuya
Copy link
Member

What issue are you referring to? Please provide the error trace.

@coenvgunst
Copy link

I think I also have the same issue in version 3.1

SassC::SyntaxError in RailsAdmin::Main#dashboard

Error: File to import not found or unreadable: rails_admin/src/rails_admin/styles/base.
on line 2:1 of app/assets/stylesheets/rails_admin.scss

@import "rails_admin/src/rails_admin/styles/base";

In my gemfile I have specified: gem 'rails_admin', '~> 3.1', git: 'https://github.com/sferik/rails_admin.git'

@mshibuya
Copy link
Member

That looks unrelated to font-awesome, please open a new issue.

@kokorolx
Copy link

kokorolx commented Jun 11, 2023

In config/initializer/assets.rb

add: Rails.application.config.assets.paths << Rails.root.join("node_modules/@fortawesome/fontawesome-free/webfonts")

In config/manifest.js
remove //= link_directory ../stylesheets .css
add //= link_tree ../builds

the manifest.js will become:

//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link_tree ../builds

I'm using rails_admin 3.1.2, ruby 3.1.4, rails 7.0.5 and it works for me.

@princetechs
Copy link

princetechs commented Jun 27, 2024

here is the perfect mainfest ;-

//= link_tree ../images
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link_tree ../builds
//= link rails_admin/src/rails_admin/base.js

Assets.rb

Rails.application.config.assets.version = '1.0'
Rails.application.config.assets.precompile += %w[application.css tailwind.css]

Rails.application.config.assets.paths << Rails.root.join('app', 'assets', 'builds')

Rails.application.config.assets.paths << Rails.root.join('node_modules/@fortawesome/fontawesome-free/webfonts')
Rails.application.config.assets.precompile += %w[.svg .eot .woff .ttf]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests