2015-11-03 96 views
0

我使用gem作为bootsrap,但glyphicon没有显示。而我得到这个错误:RoutingError with glyphicon rails

ActionController::RoutingError (No route matches [GET] "/assets/twitter/fonts/glyphicons-halflings-regular.woff"):

ActionController::RoutingError (No route matches [GET] "/assets/twitter/fonts/glyphicons-halflings-regular.ttf"):

我尝试与了解创建文件夹的字体在我的资产,但它并不能帮助我。

回答

2

解决方法之一是将文件放在应用程序的公共目录中。在你的情况将是:
(Rails_app)/public/assets/twitter/fonts/glyphicons-halflings-regular.woff
(Rails_app)/public/assets/twitter/fonts/glyphicons-halflings-regular.ttf
公共文件是您的应用程序的根目录。

0

我使用下面的步骤来解决问题:

  1. 手动下载引导包从GitHub的网站邮编:https://github.com/twbs/bootstrap
  2. 上传,然后解压缩包中的生产服务器的/ tmp文件夹
  3. 手动创建下%为approot /公共/资产/叽叽喳喳/字体
  4. 复制“自举主/字体/ *”到上面的文件夹
  5. RAILS_ENV =生产束前的文件夹ec rake资产:预编译
  6. 重新启动rails server(s)