1
我正在將舊應用程序升級到資產管道,但在按照關於升級到3.1的ryan bates教程之後,我仍無法利用管道。爲了排除我的升級過程,我創建了一個新的rails應用程序,嘗試了一些咖啡腳本並將其他文件添加到/ assets/javascripts文件夾,但除了application.js之外的任何其他文件似乎都不會呈現。Rails 3.1資產管道不工作
這是我的application.js文件:
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
alert("this displays fine");
和附加dogs.js.coffee文件:
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
alert "cant see this!"
這似乎是一個鏈輪的問題,但我真的不能找到任何與同樣的問題,或者通過require_tree在application.js中沒有包含資產文件夾內的其他javascript文件的信息。
這裏是我的寶石文件:
gem 'rails', '3.1.1'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :test do
# Pretty printed test output
gem 'turn', :require => false
end
我的紅寶石版本是2.0.0p195
感謝您的幫助!
摹