Is twitter-bootstrap-rails compatible with rails 4 and ruby 2.0. I was having tons of trouble installing this on my rails app after going through two railscast and the readme on its github page. Sorry I couldn't find a straight forward answer both in the repo's issues and from googling online.
on the repo page it says
Twitter Bootstrap for Rails 3.1 Asset Pipeline
To get bootstrap in Rail 4.
Add gem 'bootstrap-sass' to your Gemfile.
and then add #import "bootstrap-sprockets";
and #import "bootstrap";
to the top of your application.scss file. Don't forget to run bundle install.
Related
I was just fiddling around with some things and happened to run bundle install on my ruby on rails app. I noticed that bootstrap updated from 3.1.1 to 3.2.0 and now when I go to generate certain views, I get this error:
ActionController::RoutingError (No route matches [GET] "/fonts/bootstrap/glyphicons-halflings-regular.ttf"):
Didn't happen until this gem update. Any suggestions? I've tried explicitly using 3.1.1 in the Gemfile and running bundle again, but this doesn't help. It looks just like a simple routing issue, but idk why this would have only changed during the gem update.
My problem was with the order I was importing bootstrap in my application.css.scss file. Make sure the order goes:
#import "bootstrap-sprockets";
#import "bootstrap";
For anyone who else can't get an answer on this, I manually changed this file:
/home//.rvm/gems/ruby-2.1.1/gems/bootstrap-sass-3.2.0.2/assets/stylesheets/bootstrap/_glyphicons.scss and took out the $icon_path or whatever it was and replaced it with "../assets/bootstrap/
Fixed the problem thereafter.
I had the same problem like you. After some research these are the most important things i found out:
1) Since bootstrap-sass version 3.2.0 the asset directory moved from vendor/assets to assets/
source: Issue with upgrade to bootstrap-sass 3.2.0
2) The font files from customizer are probably corrupted and should be downloaded directly from the Bootstrap homepage.
source: Bootstrap 3 Glyphicons not working
As you already said; change the version back to 3.1.1.1 should do the trick. I uninstalled the gem via:
gem uninstall bootstrap-sass
Then I changed the version defined in the gemfile and reinstalled it with
gem install bootstrap-sass
bundle update
This might help people facing the same issue.
I have a working Rails 4.0 + Bootstrap 2.3 application. Now I want to update to Rails 4.1.
After updating the gems and starting the server, I receive this message:
Sass::SyntaxError - File to import not found or unreadable: bootstrap-responsive.
It point to a line in bootstrap_and_overrides.css.scss where I have this:
#import "bootstrap";
#import "bootstrap-responsive";
Both files are in the assets/stylesheets folder. When I remove the last import, the application starts, but I miss a lot of styling. What is going wrong here, any ideas?
I made 2 mistakes with this: first I did a bundle update instead of bundle update rails, so that all gems where updated, also the bootstrap and sass related gems. The second error was that I didn't have specific version numbers for the bootstrap and sass related gems in my Gemfile.
The solution was simple: remove the branch, create a new one, check Gemfile.lock for the current versions of all bootstrap and sass related gems and add these to Gemfile. Then do a bundle update rails and sit back and enjoy!
Im trying to put the bootstrap source files in my rails project but I am not seeing an "assets" folder in my app folder. Are the Image, Javascript, and CSS folders in "public" the same thing? If not then where do I put the source files? I am using ruby version 1.9.2-p290, rails version 3.0.19, and bootstrap version 2.3.2. Not sure if that makes a difference or not.
Why don't you just use a bootstrap gem like bootstrap-sass instead?
Look at this project: twitter-bootstrap-rails
It is an easy way to set up bootstrap in your Ruby on Rails project.
I'm trying to create a gem which represents a JS and CSS library and can be included in rails projects (currently using 3.2). All the style sheets are written in SASS and depend on the compass library.
I tried adding compass-rails to the Gemfile of the "external" gem and including it in the gems SASS files using
#import "compass"
However, back in the rails application (which has a dependency to this gem), this results in an error message:
File to import not found or unreadable: compass.
Am I doing something wrong?
Update: It seems to work if I add gem compass-rails to the Gemfile of the rails application. Any change to work around that?
Thanks a lot for your help!
Besides adding compass-rails to the Gemfile of the gem, you also need to require 'compass-rails' somewhere, adding it to lib/your_gem_name.rb inside the gem worked for me.
i am trying to use sass in a rails 3.0.1 project that i am working on. I install the gem but when i create a scss file and add some style nothing happens. I've been searching for an answer and it seems others have haml installed as well, do I need this?
I think you should add the assets pipeline (Sprockets) in addition to SASS.
Here is a gist that explains the setup for Rails 3.0.x.
https://gist.github.com/911003