在heroku上部署的rails 3.1项目出现问题

时间:2011-11-16 16:54:22

标签: javascript ruby-on-rails heroku ruby-on-rails-3.1 coffeescript

由于某些原因,我的项目中的.js.coffee个文件未通过:remote => true链接/表单调用

我正试图通过Ajax调用posts/new控制器。正在调用和执行控制器,但无法找到重定向的位置。

在日志中,我收到以下消息:

  

ActionView:MissingTemplate(缺少模板帖子/ new,application / new with {:handlers => [:erb,:builders] ,: formats => [:js,:html],:locale => [ :en,:en]}。搜索:*“/ app / app / views”

当我将new.js.coffee文件更改为new.js时,它可以正常工作。知道怎么做,我也可以运行Coffee脚本文件吗?

更新

我的Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.1'

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

group :development do
    gem 'sqlite3'
end

group :deployment do
    gem 'pg'
end

gem 'devise', '1.4.9'
gem 'omniauth', '1.0.0'
gem 'omniauth-facebook'
gem 'rails_autolink'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end

1 个答案:

答案 0 :(得分:6)

gem 'coffee-rails'行放在:assets组之外,可能在jquery-rails宝石线后面。生产过程中不会使用:assets宝石。