0

我知道这个问题已经被问了一遍一遍甚至在这里......我已经尝试了所有这些更改,但仍然没有这样的运气。我的 heroku 应用程序位于http://calm-mountain-2401.herokuapp.com/,对此我感到非常沮丧。我的 gemfile 看起来像:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

group :production do
  gem 'pg'
end
group :development, :test do
  gem 'sqlite3'
end

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# 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', '~> 1.2'


gem 'jquery-turbolinks'


group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

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

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

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

# Use debugger
# gem 'debugger', group: [:development, :test]

我已经能够成功部署,但是代码显然不是 CSS 化的。任何帮助将非常感激!

亚历克斯

编辑:这是 git push heroku master 的输出

$ git push heroku master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 496 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)

-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --  binstubs vendor/bundle/bin --deployment
       Using rake (10.1.0)
       Using i18n (0.6.5)
       Using minitest (4.7.5)
       Using multi_json (1.8.0)
       Using atomic (1.1.14)
       Using thread_safe (0.1.3)
       Using tzinfo (0.3.37)
       Using activesupport (4.0.0)
       Using builder (3.1.4)
       Using erubis (2.7.0)
       Using rack (1.5.2)
       Using rack-test (0.6.2)
       Using actionpack (4.0.0)
       Using mime-types (1.25)
       Using polyglot (0.3.3)
       Using treetop (1.4.15)
       Using mail (2.5.4)
       Using actionmailer (4.0.0)
       Using activemodel (4.0.0)
       Using activerecord-deprecated_finders (1.0.3)
       Using arel (4.0.0)
       Using activerecord (4.0.0)
       Using coffee-script-source (1.6.3)
       Using execjs (2.0.1)
       Using coffee-script (2.2.0)
       Using thor (0.18.1)
       Using railties (4.0.0)
       Using coffee-rails (4.0.0)
       Using hike (1.2.3)
       Using jbuilder (1.5.1)
       Using jquery-rails (3.0.4)
       Using turbolinks (1.3.0)
       Using jquery-turbolinks (2.0.1)
       Using json (1.8.0)
       Using pg (0.16.0)
       Using bundler (1.3.2)
       Using tilt (1.4.1)
       Using sprockets (2.10.0)
       Using sprockets-rails (2.0.0)
       Using rails (4.0.0)
       Using rdoc (3.12.2)
       Using sass (3.2.10)
       Using sass-rails (4.0.0)
       Using sdoc (0.3.20)
       Using uglifier (2.2.1)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Detected manifest file, assuming assets were compiled locally
-----> WARNINGS:
       Include 'rails_12factor' gem to enable all platform features
       See https://devcenter.heroku.com/articles/rails-integration-gems for more information.

       You have not declared a Ruby version in your Gemfile.
       To set your Ruby version add this line to your Gemfile:
       ruby '2.0.0'
       # See https://devcenter.heroku.com/articles/ruby-versions for more information."
-----> Discovering process types
       Procfile declares types      -> (none)
       Default types for Ruby/Rails -> console, rake, web, worker

-----> Compiled slug size: 38.5MB
-----> Launching... done, v8
       http://calm-mountain-2401.herokuapp.com deployed to Heroku

To git@heroku.com:calm-mountain-2401.git
   6e49406..83bf74d  master -> master`
4

2 回答 2

0

对我来说,解决了 pdoherty926 的问题。

尝试添加 rails_12factor 和 rails3_serve_static_assets (我知道您没有使用 Rails 3) gem。

于 2014-05-07T08:32:20.120 回答
0

您是否尝试过明确地预编译您的资产?

heroku run bundle exec rake assets:precompile
于 2013-09-20T04:51:20.073 回答