貌似社区里有人问这个问题,但是没有下文了,今天我也出现这个问题了,首先用的是 webrick,直接 rails s 启动 3000 端口,然后访问页面直接报错:ActionView::Template::Error (cannot load such file -- less(in home/naitnix/workspace/boot_strap/app/assets/stylesheets/bootstrap_and_overrides.css.less)): google 了一下,都说需要重新启动下 server,然后刷新页面,结果我试了 N 次,均以失败告终,下面是我的 Gemfile: group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'therubyracer', :platforms => :ruby gem 'uglifier', '>= 1.0.3' gem 'twitter-bootstrap-rails' end
bundle 以后执行: rails g bootstrap:install,生成以下文件:
insert app/assets/javascripts/application.js create app/assets/javascripts/bootstrap.js.coffee create app/assets/stylesheets/bootstrap_and_overrides.css.less gsub app/assets/stylesheets/application.css gsub app/assets/stylesheets/application.css
只有重启 server: rails s #webrick 重启,默认 3000 端口,启动环境为 development
之后刷新页面,结果出错,如上所示,求解