0

Im having the exact same problem as stated on this answered post - nav-collapse not working [Twitter Bootstrap]

I apologize for being a newbie but I assume the answer here means that I should place:

<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">

in the HEAD section of my application.html.erb file.

Well, I've done this and the icon is still not appearing. Is there anything else I need to do?

Here's my GEMFILE source:

source 'https://rubygems.org'

gem 'rails', '3.2.8'
gem 'bcrypt-ruby', '3.0.1'
gem "possessive" 
  #gem 'therubyracer', :platforms => :ruby
gem 'bootstrap-sass', '2.0.4'


# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'pg'

gem 'annotate', '2.5.0', group: :development


# 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'
  gem 'uglifier', '>= 1.0.3'
  gem 'jquery-ui-rails'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes

end

gem 'jquery-rails'

# 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'
Community
  • 1
  • 1
nfriend21
  • 2,170
  • 1
  • 21
  • 21

1 Answers1

1

Make sure you have this files with correct lines.

 # app/assets/stylesheets/application.css
 /*
 *= require_self
 *= require_tree .    <-- Require all files in stylesheets directory
 */

 # app/assets/stylesheets/bootstrap_and_overrides.css.less
 @import "twitter/bootstrap/bootstrap";
 @import "twitter/bootstrap/responsive";   <-- These two lines in the beginning of file


 # app/views/layout/application.html.erb
 = stylesheet_link_tag "application", media: "all" <-- Yes, it should be in head section

Did you run $ rails g bootstrap:install – it should do all this work for you automagically.

Nick Kugaevsky
  • 2,935
  • 1
  • 18
  • 22
  • ok you're awesome. I currently dont even have the file bootstrap_and_overrides.css.less, where do I get it? Also, when I run the rails g bootstrap:install, it says "could not find generator bootstrap:install". Ive had some problems since Im doing this on Windows 7. Any thoughts where I can grab that file? I tried downloading all the files from the bootstrap site, but that file does not exist in their zip file. Oh - I should also let you know that I have many other bootstrap things already working...the layout css, pop-up modal panels, etc. so I know its installed. – nfriend21 Sep 12 '12 at 22:55
  • You could take source of `bootstrap_and_overrides.css.less` here – https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less – Nick Kugaevsky Sep 12 '12 at 23:00
  • ok did that, but now I got this error "LoadError in Projects#index Showing C:/Sites/task_mgr/app/views/layouts/application.html.erb where line #5 raised: cannot load such file -- less (in C:/Sites/task_mgr/app/assets/stylesheets/bootstrap_and_overrides.css.less)" – nfriend21 Sep 12 '12 at 23:07
  • Please, add your `Gemfile` source to question. – Nick Kugaevsky Sep 12 '12 at 23:08
  • Oh, I see. You use another rails gem than I think (from your tags). Just try this https://github.com/seyhunak/twitter-bootstrap-rails instead of `bootstrap-sass`. With it everything should be ok. Including bootstrap files generator. – Nick Kugaevsky Sep 13 '12 at 00:50