2016-02-13 56 views
0

我有一个基础6宝石的轨道应用程序,可以在本地很好地渲染,但只要我推到一个dokku服务器,布局就不会渲染。zurb基础6在轨道上4在本地工作,但不在dokku上

在Chrome devlopper控制台我发现了以下错误:

Uncaught ReferenceError: $ is not defined 

我的Gemfile

source 'https://rubygems.org' 

gem 'rails_12factor', group: :production 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.2.4' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.1.0' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

#CMS 
gem 'comfortable_mexican_sofa', '~> 1.12.0' 
gem 'comfy_blog', '~> 1.12.0' 
#foundation 
gem 'foundation_rails_helper' 
gem 'foundation-rails', github: "zurb/foundation-rails" 
gem 'foundation-icons-sass-rails' 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0', group: :doc 

# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Unicorn as the app server 
gem 'puma' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug' 
end 

group :production do 
    gem 'pg' 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> in views 
    gem 'web-console', '~> 2.0' 

    # Use sqlite3 as the database for Active Record 
    gem 'sqlite3' 

    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
end 

ruby "2.2.2" 

编辑: 我已经意识到,本地application.erb.html插入,但在dokku它不是。

回答

0

确保资源已预编译。在生产环境中,'rake资产:预编译'必须在rails服务器启动之前运行。

+0

亲爱的gugl,我已经做到了。我现在意识到问题在于别的地方。我使用Comfy墨西哥沙发,并与SQLite application.html.erb包括正确(在开发和生产),但只要我切换到PostgresQL不是这种情况了,我留下了布局我已经进入了Comfy。 –

相关问题