Precompiling assets doesn't seem to be working - ruby-on-rails

I'm having a strange problem that I have never encountered when deploying my rails apps to production.
I run:
bundle exec rake assets:precompile
This is the output:
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /home/ubuntu/.rvm/gems/ruby-2.0.0-p0/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
This is my app/assets/javascripts/application.js:
//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require twitter/bootstrap
//= require_tree .
And this is my app/assets/stylesheets/application.css:
/*
*= require_self
*= require jquery.ui.all
*= require_tree .
*/
After I precompile, this is my public/assets/application-946a5a61f067fe19fe65ffd12f8c4a20.js
//= require jquery
//= require jquery_ujs
//= require jquery.ui.all
//= require twitter/bootstrap
//= require_tree .
So it's exactly the same as the original file.
And public/assets/application-df7525e917401704ef453cb56bf16697.css is an empty file.
This is my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'settingslogic'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'json'
gem 'will_paginate', '~>3.0.pre2'
gem 'friendly_id', '~> 4.0.0.beta14'
gem 'rails3-jquery-autocomplete'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'paperclip', '~> 3.0'
gem 'public_activity'
gem 'rails-timeago'
gem 'therubyracer', :require => 'v8'
gem 'less-rails'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier', '>= 1.0.3'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
And config/environments/production.rb:
Yupp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
#config.assets.initialize_on_precompile = false
#...
end
Any direction will be greatly appreciated.

What solved the problem for me :
set the last rails version in Gemfile (3.2.14 for now)
bundle update
bundle install
restart the app touch tmp/restart.txt

I spent 2 hours on this then I found https://github.com/sstephenson/sprockets/issues/352
I tried downgrade ruby to 1.9.3 and do precompile then add compiled files to repo.. This isn't what I want but it works..
Update: what rails version are you using ? I was using 3.2.2 which has problem like this. 3.2.13 works fine(with ruby 2.0).

Related

".js is not present in the asset pipeline"

I know this is a very repeated question but I have done everything by the books, read a bunch of SO posts and none have helped so far.......
assets.rb
Rails.application.config.assets.version = '1.0'
Rails.application.config.assets.paths << Rails.root.join('node_modules')
application.js:
//= require rails-ujs
//= require activestorage
//= require jquery3
//= require popper
//= require bootstrap-sprockets
//= require turbolinks
//= require_tree .
production.rb:
...
config.assets.js_compressor = Uglifier.new(harmony: true)
config.assets.compile = false
...
gems ( i assume can possible affect this):
gem 'webpacker'
gem 'react-rails'
gem 'bootstrap', '~> 4.3.1'
gem 'jquery-rails'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
application.rb:
require_relative 'boot'
require 'csv'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Shopify14
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
config.serve_static_assets = true
# config.active_job.queue_adapter = :sidekiq
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
end
end
I tried adding application.js to the assets.rb file. (Even though it's already included), but that didn't work.
None of my app/assets/javascript/{} files will work with:
<%= javascript_include_tag "javascript.js" %> without the asset pipeline error message in the console.
I am using heroku
Is there something I am missing?
I would rather not directly add these files to the assets.rb file because these are mostly page specific js files i want to use.

rake aborted! Sass::SyntaxError: Undefined variable: "$alert-padding"

I got stuck on production environment for rails application because my assets are not compiled. When I use
rvmsudo bundle exec rake assets:precompile RAILS_ENV=production --trace
It throws rake aborted! Sass::SyntaxError: Undefined variable: "$alert-padding"
Here is my Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.3'
gem 'mysql2', '~> 0.3.11'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'haml'
gem 'haml-rails'
gem 'devise', github: 'plataformatec/devise'
gem 'html2haml'
gem 'simple_form'
gem 'validates_formatting_of'
gem 'tzinfo-data'
gem 'therubyracer', platforms: :ruby
gem 'twitter-bootstrap-rails'
gem 'jquery-validation-rails'
gem 'sprockets-rails', :require => 'sprockets/railtie'
gem 'jquery-turbolinks'
gem 'paperclip'
gem 'fancybox-rails'
gem 'css3-progress-bar-rails'
group :development do
gem 'spring'
gem 'pry-rails'
gem 'better_errors'
end
group :development, :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
end
gem 'delayed_job_active_record'
# Need daemons to start delayed_job
gem 'daemons'
gem 'rails_config', '~> 0.4.2'
gem 'cancan'
gem 'two_factor_authentication'
gem 'twilio-ruby'
gem 'binding_of_caller'
gem 'rest-client'
Here is my porduction.rb
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = true
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
config.assets.compile = false
config.assets.compress = false
config.assets.digest = true
config.log_level = :debug
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => Settings.PROD_URL }
config.log_formatter = ::Logger::Formatter.new
config.active_record.dump_schema_after_migration = false
end
And application.css:
/*
*= require_tree .
*= require_self
*/
So, why i am getting rake aborted! Sass::SyntaxError: Undefined variable: "$alert-padding" while compiling.
My production works but no css is loaded to it.
$alert-padding variable is used before being defined. It may be caused by a wrong order of css files in application.css. require_tree loads all files from the current folder in alphabetical order (I guess), but you need some styles to loaded in specific order.
It seems like you're using bootstrap-sass gem. Consider the following instruction from the gem's README: https://github.com/twbs/bootstrap-sass#a-ruby-on-rails You need to rename application.css to application.scss and use #import instead of require.
Just add these lines in your config/application.rb if you are using scss instead of css.
config.assets.precompile << %w( *.scss *.js )
With SASS you have to include your variables before they're called.
Dir globbing / Sprockets include files alphabetically:
This has the problem that files are required alphabetically. If your directory has jquery-ui.js and jquery.min.js then Sprockets will require jquery-ui.js before jquery is required which won't work (because jquery-ui depends on jquery).
This means if you're using a variables.sass (or similar), you'll want to either rename it, or include it explicitly:
/*
*= require variables
*= require_tree .
*= require_self
*= stub variables
*/
Even better (since you're using SASS), use the #import directive:
#app/assets/stylesheets/application.sass
#import variables
#import *
I had a same issue
I just added this two lines in environment/production.rb
config.assets.compile = true
config.assets.precompile += %w( active_admin.css.scss )
It works for me.

Rails error include jquery.ui.all

I have an error when I try to include jquery.ui.all. All worked perfectly befor that I reboot my computer but now I have this error :
couldn't find file 'jquery.ui.all'
I rebooted my server, I try to clear the cache from the Rails console and on my navigators and I still have the problem. I also tried to to delete the Gemfile.lock and run bundle install and still the same error.
Here my both application.js and application.css :
//= require ./plugins/jquery-1.10.2.min
//= require jquery_ujs
//= require fullcalendar
//= require jquery.ui.all
//= require ./plugins/jquery-migrate-1.2.1.min
//= require ./plugins/bootstrap/js/bootstrap.min
//= require turbolinks
//= require underscore-min
//= require gmaps_google
*= require_self
*
* CSS Global Compulsory
*= require ./plugins/bootstrap/css/bootstrap.min
*= require style
*
* CSS Implementing Plugins
*= require ./plugins/line-icons/line-icons
*= require ./plugins/font-awesome/css/font-awesome.min
*= require ./plugins/flexslider/flexslider
*= require ./plugins/bxslider/jquery.bxslider
*= require ./plugins/layer_slider/css/layerslider
*= require ./plugins/hover-effect/css/custom-hover-effects
*= require ./plugins/sky-forms/version-2.0.1/css/custom-sky-forms
*
* CSS Theme
*= require ./themes/orange.css
*
* CSS Customization
*= require custom
*= require fullcalendar
*= require jquery.ui.all
*/
And my Gemfile :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use mysql2 as the database for Active Record
gem "mysql2", "~> 0.3.15"
# gem "mysql2", "0.3.11"
# Use PostgreSql at the database for Active Record
gem "pg"
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Bundle Pagination
gem 'will_paginate', '~> 3.0'
gem 'will_paginate-bootstrap'
# Authentification, Authorize, Roling
gem 'omniauth'
gem 'devise'
gem 'omniauth-google-oauth2'
gem 'cancan'
gem 'rolify', :git => "git://github.com/EppO/rolify.git"
# Géolocalisation
gem 'geocoder'
gem 'gmaps4rails'
# API Builder
gem 'rabl'
# Json Parser
gem 'oj'
# Upload de Fichier
gem "paperclip", "~> 4.1"
# Fullcalendar
gem 'fullcalendar-rails'
Ok I find the problem,
The problem is from the update of the gem jquery-ui-rails. Befor the include was :
jquery.ui.all
and now :
jquery-ui
Hope that it can me helpful

Datatable works in development mode, but doens't work in production - assets

I have a problem, I think my problem is with assets, because it works in Development environment but does not work in Production.
I'm using DataTables in my app, it's works in development mode.
I follow all steps in this link:
https://github.com/rweng/jquery-datatables-rails
I searched for answers and I found many posts. I tried all, but still could not solve the issue.
P.S.: If I execute: RAILS_ENV=production bundle exec rake assets:precompile, datatable stops working in development mode too.
in Gemfile:
source 'https://rubygems.org'
gem 'rails', '~> 3.2.16'
gem 'mysql2', '~> 0.3.14'
# Autenticação
gem 'authlogic', '~> 3.3.0'
# Autorização
gem 'cancan'
# Anexos
gem 'paperclip', '~> 3.0'
# Mailer
gem 'mail', '~> 2.5.4'
# Custom select
gem "bootstrap-select-rails", "~> 1.3.0"
#
gem 'whenever', :require => false
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '~> 1.0.3'
gem 'therubyracer', '~> 0.12.0'
end
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
gem 'less-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails', '~> 4.1.1'
# twitter bootstrap css & javascript toolkit
gem 'twitter-bootswatch-rails', '~> 3.0.3'
# twitter bootstrap helpers gem, e.g., alerts etc...
gem 'twitter-bootswatch-rails-helpers'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
assets/javascripts/aplication.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require jquery.ui.all
//= require jquery.ui.tabs
//= require jquery.ui.tabs.min
//= require bootstrap-tabs
//= require interns
//= require systems_analysts
//= require generics
//= require file_field
//= require bootstrap-filestyle
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap
//= require cocoon
assets/javascripts/interns.js
// Ordenação dos Grids por coluna
$(document).ready(function() {
$('#hr_curriculum_interns').dataTable({
"aoColumnDefs": [ // Ordenação desativada nas colunas com actions
{ 'bSortable': false, 'aTargets': [ 5, 6, 7, 8 ] }
],
"bPaginate": false,
"bFilter": false,
"bInfo": false
});}
);
assets/stylesheets/application.css
/* Cerulean
* Bootswatch
*= require_self
*= require jquery.ui.all
*= require cerulean/loader
*= require cerulean/bootswatch
*= require_tree ./custom/
*= require jquery.ui.theme
*= require jquery.ui.core
*= require dataTables/jquery.dataTables.bootstrap
*/
Any idea please?
Your issue is probably because of Rails Asset pipelining in production.
Try this..........
In config/initializers
config.assets.precompile += %w( *.js *.css )
and In environments/production.rb
config.serve_static_assets = true
then
RAILS_ENV=production rake assets:precompile
then check
RAILS_ENV=production rails s

Rails 4 + bootstrap set up assets

I am trying to setup bootstrap on Rails4 using bootstrap-sass and I am getting this famous error:
Sprockets::FileNotFound - couldn't find file 'bootstrap'
(in app/assets/javascripts/application.js:16):
I have tried following:
twitter/bootstrap in application.js
gem 'bootstrap-sass', '~> 3.1.0' is outside group assets
Also tried bunch of other things on internet
I have spend lot of time taking different suggestions from other posts. How do I systematically debug this , how to setup bootstrap-sass ?
p.s:
Also been trying to get twitter-bootstrap-rails working with no luck.
Here are some files
application.js
//= require jquery
//= require jquery_ujs
//= require js-routes
//= require bootstrap
//= require_tree .
//= require bootstrap-slider
application.css.scss
*= require jquery.ui.core
*= require jquery.ui.theme
*= require_self
*= require bootstrap-slider
*= require_tree .
*= stub active_admin
*/
#import "bootstrap";
Gemfile
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'
gem 'sass-rails'
gem 'coffee-rails', git: 'git://github.com/rails/coffee-rails.git'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-ui-rails'
gem 'font-awesome-sass'
gem 'less-rails'
gem 'therubyracer', :platform=>:ruby
#gem 'twitter-bootstrap-rails'
gem 'jquery-rails'
#gem 'jquery_mobile_rails'
gem 'js-routes'
gem 'cancan'
gem 'devise'
gem 'figaro'
gem 'haml-rails'
gem 'pg'
gem 'rolify'
gem 'sendgrid'
gem 'simple_form'
gem 'thin'
gem 'rake'
#To use db for storing cookies instead cookie-store
gem 'activerecord-session_store', github: 'rails/activerecord-session_store'
group :development do
gem 'better_errors'
#gem 'binding_of_caller', :platforms=>[:mri_19, :rbx]
#Commenting out platforms part, because may be that's stopping this to be used on the dev machine'
gem 'binding_of_caller'
gem 'guard-bundler'
gem 'guard-rails'
gem 'guard-rspec'
gem 'html2haml'
gem 'quiet_assets'
gem 'rb-fchange', :require=>false
gem 'rb-fsevent', :require=>false
gem 'rb-inotify', :require=>false
# Required with Rails panel chrome extension. This Gem should come after better_errors gem
gem 'meta_request'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'rspec-rails'
gem 'pry-byebug'
gem 'pry-stack_explorer'
gem 'pry-rails'
gem 'pry-debugger'
end
group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'email_spec'
end
group :production do
gem 'rails_12factor'
end
gem 'high_voltage'
#Linkedin Logins
gem "linkedin"
gem "omniauth"
gem "omniauth-linkedin"
gem "omniauth-facebook"
#postgres use hstore in active record
#gem 'activerecord-postgres-hstore'
gem 'state_machine'
gem "ruby-graphviz"
#payments
#gem 'stripe',:git => 'https://github.com/stripe/stripe-ruby'
#gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails', :github => 'anjlab/bootstrap-rails'
gem 'newrelic_rpm'
gem 'pgbackups-archive'
gem 'pg_search'
gem 'acts-as-taggable-on'
#gem 'activeadmin' , github: 'gregbell/active_admin'
gem "activeadmin", git: "https://github.com/gregbell/active_admin"
gem 'kaminari'
gem 'bootstrap-slider-rails'
gem 'bootstrap-sass', '~> 3.1.0'
Installing the Bootstrap Gem
1.) Add the Bootstrap Gem:
gem 'bootstrap-sass'
2.) Understand The Application.css File
app/assets/stylesheets/application.css
Application.css takes all the other files in your /stylesheets directory and combines them for when you run your app.
3.) Create a New SCSS File (app/assets/stylesheets/bootstrap_and_customization.css.scss)
#import 'bootstrap';
4.) Require Bootstrap's JavaScript
...
//= require jquery
//= require jquery_ujs
//= require bootstrap <--
//= require turbolinks
//= require_tree .
5.) Rails Assets
group :production do
gem 'rails_12factor'
end
6.) Bundle Install & Restart Server
Thats should be it !
On one of my projects (Rails 4.1) I had to include the bootstrap directly (not sass). Maybe it will give a hint on making the saas version work. So below are steps to include the bootstrap directly:
Download and and extract the bootstrap to
Rails.root/vendor/assets/bootstrap
Create file Rails.root/vendor/assets/javascripts/bootstrap.js file with contents like this:
//= require ../bootstrap/js/bootstrap.js
Now the most important part to make icons work. The font file urls have to be overridden for the Glyphicons Halflings font. Also asset_path helper has to be used. So create file Rails.root/vendor/assets/stylesheets/bootstrap.css.erb file with contents like this.
/*
=require ../bootstrap/css/bootstrap.css
*/
#font-face {
font-family: 'Glyphicons Halflings';
src: url("<%= asset_path 'glyphicons-halflings-regular.eot' %>");
src: url("<%= asset_path 'glyphicons-halflings-regular.eot?#iefix' %>") format('embedded-opentype'), url("<%= asset_path 'glyphicons-halflings-regular.woff2' %>") format('woff2'), url("<%= asset_url 'glyphicons-halflings-regular.woff' %>") format('woff'), url("<%= asset_path 'glyphicons-halflings-regular.ttf' %>") format('truetype'), url("<%= asset_path 'glyphicons-halflings-regular.svg#glyphicons_halflingsregular' %>") format('svg');
}
Now require bootstrap in the application.js and application.css
application.js
//= require bootstrap
application.css
*= require bootstrap
And finally let assets pipeline be aware of the fonts path and additional extensions to precompile. In the application.rb add:
config.assets.paths << Rails.root.join("vendor", "assets", "bootstrap", "fonts")
config.assets.precompile += %w( *.eot *.svg *.ttf *.woff *.woff2 )
After that RAILS_ENV=production rake assets:precompile should show that is has recognized font files and copied them to the public assets folder.
Then to test if it works in production enable serving static assets (in production.rb: config.serve_static_assets = true) and RAILS_ENV=production rails s
I ended up using bootstrap from a hosted CDN
%link{href: "//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css", rel: "stylesheet"}/
%link{href: "//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" , rel: "stylesheet"}/
%link{href: "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css", rel: "stylesheet"}/
I had exactly the same error. The solution was to change in:
config/environments/production.rb
The line
config.serve_static_assets = false
to
config.serve_static_assets = true
I'm not exactly aware of what this line does, but my workteam had the same problem on a project, and they changed this line, and it worked.
Try this:
Open config/application.rb, add the following line:
config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
In your config.ru file, add
require 'bootstrap-sass'
Rename your application.css.scss to something else e.g. custom_bootstrap.css.scss. I have no idea why it makes a difference but it did in my case.
Also, from what I understand, by default bootstrap-sass does not require you to add
//require bootstrap
to your application.js. Apparently it breaks some kind of functionality.
i had the same issue :couldn't find file 'bootstrap-sprockets' with type 'application/javascript'
The only solution was to comment off in the Gemfile
gem 'sass-rails', '~> 5.0' and add instead
gem 'sass-rails', '>= 3.2'
hope this helps other members
The fix for me was two parts ... my correct list first ... but the list alone wasn't the fix!
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass', '~> 3.3.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
Then I had a gemfile.Lock issue ... if anyone else can't get the files to load & doesn't want to use the CDN...check your gemfile.Lock & see what versions are compiled off the gemfile (one is input for us as dev's & the other is what is actually ran by the framework - it will cause issues if you try to modify gemfile.lock).
To resolve the gemfile lock...close the gemfile & gemfile.Lock
I had to first delete the items in question from the "gemfile".
I did a "gem install <name of gemfile>" I wanted for each of them.
Then open the gemfile & gemfile.Lock to check results. Note, you still have to do all the configuration bootstrap etc requires for each of these. It doesn't hurt to run a rails assets:precompile either.
Note: The rails assets:precompile is a rails 5 command.
add to Gemfile
gem 'font-awesome-rails'
do bundle install
add to application.css
*= require font-awesome
and, restart rails server.

Resources