-
Notifications
You must be signed in to change notification settings - Fork 244
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
Rails Engine - File to import not found or unreadable: font-awesome #130
Comments
Could you please include some more details about the versions of rails and related gems that you're locked to as well? e.g. The version of sass-rails that you're currently tied to is 1 major version behind, but that might make sense considering the version of rails you're working against. |
To make it easier to look at what I am doing, I added the testeng Rails Engine to my repositories. |
@elrayle Thanks that published project should help, but I've been really swamped lately, and I probably won't have time to investigate this anytime soon. If anyone else has some free cycles to investigate, much appreciation. In the meantime, @elrayle, if you're able to better debug this yourself and provide a recommended solution here, I'd be happy to review it. |
+1 having the same error. (I haven't built the simple test app yet) I can't see fontawesome anything in the load paths
|
I seem to have moved on by using @import 'font-awesome.css' |
I tried the @import 'font-awesome.css'. It did indeed get rid of the error File to import not found or unreadable: font-awesome during start-up. I now get an error when I try to use a font-awesome icon: No route matches [GET] "/assets/testeng/font-awesome.css". anitagraham, did you see this issue? I updated the testeng on github to include
|
After running
here is the changes,is this sprockets related?
|
I think I ended up using 'gem font-awesome-sass' instead. |
+1 still an issue - rails 4.2, fresh engine. |
I don't personally use font-awesome-rails in any engines, but a pull-request or a pointer to some docs that shows what this gem is missing, and I'd be glad to review it. |
Nevermind, I did a quick search, and I actually see where things might have gone awry for engine support. I'm investigating a fix now. |
Okay. For everyone building Rails Engines that depend on font-awesome-rails, I think you just need to make sure that you manually For example, I just submitted a pull-request to @elrayle's test engine: Here's an article that helps explain why this might be necessary: Here's a StackOverflow answer that helps confirm this: I did a quick test myself, and things seemed to work as expected afterwards. If someone could chime in and confirm that this also works for their own engine, I'll go ahead and close out this issue after adding something to the README too. |
using |
Closing this out due to lack of follow-up. The solution I presented above should be the correct approach for including tie gem in rails engines. PRs welcome if there's something that this gem can add to make it even easier. |
got same issues ... not ready for normal gem use w Rails 4.2.3 and Bootstrap 3 |
+1 |
@Erwin16 @Preen When building an engine that depends on font-awesome-rails, be sure to follow the instructions in this new README update: https://github.com/bokmann/font-awesome-rails#rails-engines |
For anyone still coming across this error and not using engines, I had to also upgrade to |
Restart app. |
@rmm5t And of course you mean Requiring this at the top of my |
@voltechs No. I meant what I wrote. Your suggestion implies a different project/gem than this one. |
Hi all, The @rmm5t point on updating the engine (please follow the stackoverflow link) is correct and solve my issue. |
For me using |
Okay, I seem to be having a problem in my engine despite the remedies y'all have suggested. Tried this, which gave me this error: # show.html.erb
<%= fa_icon "campground" %> Tried this, which didn't error but also didn't show anything # show.html.erb
<i class="fa fa-campground"></i> I went through that (very helpful) stackoverflow solution to check my files.... I already have the gem in my engine's # engines/enginely/enginely.gemspec
spec.add_dependency "rails", "~> 5.2.6"
spec.add_dependency "bootstrap"
spec.add_dependency "jquery-rails"
spec.add_dependency "font-awesome-rails" My engine's # engines/enginely/Gemfile
gemspec For my manual requiring... # engines/enginely/lib/enginely/engine.rb
require 'font-awesome-rails'
require 'bootstrap'
require 'jquery-rails'
require 'sass-rails'
require 'bootstrap-sass'
require 'enginely/engine'
module Enginely
class Engine < ::Rails::Engine as well as the neat logic to automatically require # engines/enginely/lib/enginely/engine.rb
Gem.loaded_specs['trailblazer'].dependencies.each do |d|
require d.name unless d.type == :development
end
require 'enginely/engine'
module Enginely
class Engine < ::Rails::Engine For 💩 and giggles, I also tried adding some new files to see if they would work... Like an assets initializer... # engines/enginely/config/initializers/assets.rb
require "bootstrap"
require "jquery-rails"
require "font-awesome-rails"
require "sass-rails"
require "bootstrap-sass" And an engine file inside my assets... # engines/enginely/app/assets/engine.rb
require "bootstrap"
require "jquery-rails"
require "font-awesome-rails"
require "sass-rails"
require "bootstrap-sass" I ran |
I did a super simple rails app and used font-awesome with no problem. Expanding this to do the same steps in a rails engine produces the following error. I am guessing this will be a simple fix, but I haven't been able to find one.
Steps to generate the engine and setup font-awesome...
create the basic engine with one model class for testing
add in font-awesome
start rails server
Test in browser
http://localhost:3000/testeng/books
Get ERROR
The text was updated successfully, but these errors were encountered: