4

私はEnkiblogginggemを使用しています。これはローカルで動作し、herokuにプッシュする準備をしようとしています(これまで問題はありませんでした)。私はプリコンパイルしようとしました、そしてそれはこれをしました

/Users/me/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby /Users/me/.rvm/gems/ruby-1.9.3-rc1@ruby193/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
cannot load such file -- uglifier
  (in /Users/me/Sites/bayani/app/assets/javascripts/admin.js)

エンキのブログをHerokuにプッシュするのに苦労したことはありません。醜いものがどこにあるかはわかりませんが、プッシュした他のエンキのブログで見たことがあるので、なぜ今問題が発生しているのかわかりません。 。

Herokuにプッシュすると、プリコンパイルも中止されました

Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       no such file to load -- uglifier
       (in /tmp/build_5tbsi7k7ddhk/app/assets/javascripts/admin.js)
       Tasks: TOP => assets:precompile:primary
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

それが提供したリンクでトラブルシューティングの記事を読んだ後、私はこれをapplication.rbに入れました

config.assets.initialize_on_precompile = false

しかし、私はまだ同じ問題を抱えています

これはadmin.jsです。これは単なるマニフェストファイルです。これはenkiへのリンクですhttps://github.com/xaviershay/enki

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require jquery.livequery
//= require jquery.form
//= require jquery.easing.1.3
//= require humanmsg
//= require_tree ./admin
4

1 に答える 1

13

Gemfile に以下を追加します。

group :assets do
  gem 'therubyracer'
  gem 'sass-rails', "  ~> 3.1.0"
  gem 'coffee-rails', "~> 3.1.0"
  gem 'uglifier'
end

走る

バンドル インストール

rake アセット:プリコンパイル

お役に立てば幸いです。

于 2012-07-12T05:20:19.190 に答える