I get the following error after updating Devise bootstrap views to the latest version (1.1.0). Everything works OK if I switch back to v0.0.11.
What is the problem?
In my Gemfile I have this
gem 'devise'
gem "twitter-bootstrap-rails"
gem "devise-bootstrap-views"
application.css
/*
*= require devise_bootstrap_views
*= require_tree .
*= require_self
*/
bootstrap_and_overrides.css
/*
=require twitter-bootstrap-static/bootstrap
Static version of css will use Glyphicons sprites by default
=require twitter-bootstrap-static/sprites
*/
application.js
//
//= require rails-ujs
//= require jquery
//= require twitter/bootstrap
// require turbolinks
//= require Chart.bundle
//= require chartkick
//= require_tree .
I know this is an old question, but I guess this is a duplicate of Question #52636393.
I had this same problem while updating dependencies from an old project of mine. All I had to do was to remove the following line from application.css
*= require devise_bootstrap_views
Look for this line in your css/sass files and try removing it. Oh, and remember to restart your server :)
I hope it helps.
Related
My computer system is Mac OS. In the past few days, I was working on a rails project and I tried to use Bootstrap in my app. Followed by the instruction of Bootstrap website, I changed some files' contents but it still didn't work. Can somebody help me?
This is the code in application.scss:
#import "bootstrap-sprockets";
#import "bootstrap";
This is the code in application.js:
//= require rails-ujs
//= require activestorage
//= require turbolinks
//= require_tree .
This is my Gemfile:
gem 'bootstrap-sass', '3.3.7'
I have also run 'bundle install' on my console. However, nothing happened in my pages.
Your application.js is missing the bootstrap files. Add those and you are good to go. Just add the below
//= require bootstrap-sprockets
to the application.js
I am using jquery datepicker for my active admin. I upgraded my app from rails 4.6 to rails 5 then my app started to fail.
couldn't find file 'jquery-ui/datepicker' with type 'application/javascript'
I added gem 'jquery-ui-rails' gem and added //= require jquery-ui in application.js and *= require jquery-ui but still my problem didn't solved.
application.js
//= require_self
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require jquery-ui/widgets/datepicker
in your application.js
//= require jquery-ui/widgets/datepicker
and restart your server
Update:
Rearrange your js as following and restart your server.
//= require_self
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require jquery-ui/widgets/datepicker
//= require_tree .
You may need to upgrade your 'active_admin_datetimepicker', so try to update your Gemfile with:
gem 'active_admin_datetimepicker', '=0.6.3'
I'm trying to use startbootstrap themes to my rails application
http://startbootstrap.com/template-overviews/creative/
I have download the themes extract it
move the css folder into vendor/stylesheets
move the javascript folder into vendor/javascripts
edit the index.html file and remove all the dependencies from there(remove the css and remove the javascript)
then
I edit my application.js and application.css to include the css and js files from the themes
application.js
//= require vendor/jquery/jquery.min.js
//= require vendor/bootstrap/js/bootstrap.min.js
//= require vendor/scrollreveal/scrollreveal.min.js
//= require vendor/magnific-popup/jquery.magnific-popup.min.js
//= require js/creative.min.js
application.css
*= require vendor/bootstrap/css/bootstrap.min.css
*= require vendor/font-awesome/css/font-awesome.min.css
*= require vendor/magnific-popup/magnific-popup.css
*= require css/creative.min.css
the css and image is working properly but the javascripts never work Idk why
so far my workaround is copy all the files into public folder
You can directly install the bootstrap gem and install it.
Open your gemfile and put:
gem 'bootstrap-sass', '~> 3.3.6'
bundle install.
Open your application.css and put:
#import "bootstrap-sprockets";
#import "bootstrap";
Rename your application.css to application.scss
Open your application.js and put:
//= require jquery
//= require bootstrap-sprockets
I am trying to install my first gem in Ruby, but am having problems with it working. I am not quite sure where I am going wrong, I am following the directions of the gem step by step. I am using Cloud9 for my ide.
The gem I am trying to install is the: wysiwyg-rails gem
I add the following line to the gem file:
gem 'wysiwyg-rails', '1.2.5'
then I add the following to the application.css file so it looks like:
/*
*= require froala_editor.min.css
*= require froala_style.min.css
*= require font-awesome
*= require_tree .
*= require_self
*/
And finally I add the require .js file to the application.js:
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require froala_editor.min.js
//= require plugins/tables.min.js
//= require_tree .
I run bundle install and then restart the server. When I try to load the page, I get the error: couldn't find file 'font-awesome'
However, i can see that font-awesome is installed
Using font-awesome-rails 4.2.0.0
If I remove the *= require font-awesome from the application.css, it starts up without any errors. When I view the source code, I can see the css and js files ( froala_editor) load up, but font-awesome is not one of them. Is there a step that I am missing?
Thanks!
the problem is very strange,the reason is unknown,but i resloved in my program,just add "font-awesome-rails" gem.
gem "font-awesome-rails"
Have you tried installing with font-awesome-less or font-awesome-sass gems to get them up and running?
It seems you are running without any sprockets (asset-pipeline). Add any of those gems, it probably run fine when serving rails s.
After bundle install, go to application.css and write this code as it follows:
#import "font-awesome-sprockets"
#import "font-awesome"
Hope that helps.
For some reason my bootstrap broke after I precompiled my code. This started because I couldn't push to heroku because of a precompile error.
So here are the contents of my application.js file:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap3
//= require bootstrap
//= require bootstrap/dropdown
//= require_tree .
Maybe the order is wrong? I just added .../dropdown hoping it would help, but it did not. I just realized I can actually remove both bootstrap lines without affecting my resulting site.
For my gems, I have:
gem 'bootstrap-sass', "~>3.0.3.0"
...
gem 'bootstrap-will_paginate', '0.0.6'
Here is a link to my other question, which is similar but less focused: Ruby on Rails: Ran rake assets:precompile and now both local and heroku deployment don't include bootstrap
Any help would be greatly appreciated. I'm getting pretty frustrated, it's been several days of failed action.