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

couldn't find file 'dataTables/bootstrap/3/jquery.dataTables.bootstrap' with type 'text/css' #175

Open
mcshakes opened this issue May 11, 2015 · 8 comments

Comments

@mcshakes
Copy link

Hey, trying to add Bootstrap 3 and Datatables together.

Here is my gemfile:

source 'https://rubygems.org'

gem 'rails', '4.2.1'
gem 'pg'
gem 'sass-rails', '> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '
> 4.1.0'
gem 'bootstrap-sass', '> 3.3.4'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '
> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'mocha'

gem 'bcrypt', '> 3.1.7'
gem 'jquery-datatables-rails', '
> 1.12.2'

group :development, :test do
gem 'byebug'
gem 'pry'
gem 'better_errors'
gem 'binding_of_caller'
gem 'capybara'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'launchy'
gem 'database_cleaner'
gem 'minitest-rails-capybara'
end

application.js

//= require jquery
//= require jquery_ujs
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require bootstrap-sprockets
//= require jquery-ui
//= require turbolinks
//= require_tree .

and application.css

*= require_tree .
*= require_self
*= require dataTables/jquery.dataTables
*= require dataTables/bootstrap/3/jquery.dataTables.bootstrap

*= require_directory .

Do I have to instead put those within application.css in application.scss for it to work properly?

Thanks.

@jh125486
Copy link
Contributor

Since the stylesheets are .scss, you'll have to put the extension like *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap.scss
If you are using the Bootstrap 3 stylesheets, don't load the dataTables/jquery.dataTables stylesheet; it conflicts as I recall.

Also, you probably need to do a *= require bootstrap to get the base Bootstrap 3 stylesheets loaded.

@anquinn
Copy link

anquinn commented Jul 9, 2015

same error here. It doesn't seem to actually be installing the files anywhere, just adding the require lines.

@jh125486
Copy link
Contributor

Can you run Rails.application.config.assets.paths from rails console and paste what's there?

@anquinn
Copy link

anquinn commented Jul 11, 2015

["/Users/andrew/Projects/targets_dashboard/app/assets/images", "/Users/andrew/Projects/targets_dashboard/app/assets/javascripts", "/Users/andrew/Projects/targets_dashboard/app/assets/stylesheets", "/Users/andrew/Projects/targets_dashboard/vendor/assets/javascripts", "/Users/andrew/Projects/targets_dashboard/vendor/assets/stylesheets", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jquery-datatables-rails-3.3.0/app/assets/images", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jquery-datatables-rails-3.3.0/app/assets/javascripts", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jquery-datatables-rails-3.3.0/app/assets/media", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jquery-datatables-rails-3.3.0/app/assets/stylesheets", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/turbolinks-2.5.3/lib/assets/javascripts", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jquery-rails-3.1.3/vendor/assets/javascripts", "/Users/andrew/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/coffee-rails-4.0.1/lib/assets/javascripts"]

@jh125486
Copy link
Contributor

Hrmm, it shows to be adding the correct paths for jquery-datatables-rails... which gem are you loading up for the Bootstrap assets?

@anquinn
Copy link

anquinn commented Jul 14, 2015

I'm manually loading a custom build of the core bootstrap. I get the same error when I tried with the vanilla version of datatables (different path of course) . The only way I found around it was to manually copy the assets (css, js, images) into the pipeline directory.

@ariawanzero
Copy link

i want to ask anyone who can import this style on .css.scss file because i'm always get error in this import like @import dataTables/bootstrap/3/jquery.dataTables.bootstrap

@ariawanzero
Copy link

ariawanzero commented May 18, 2017

yeah i'm already get the solution like this @import "dataTables/bootstrap/3/jquery.dataTables.bootstrap.scss";

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

4 participants