3

我正在将 Rails 应用程序从 3.2.12 更新到 4.0.0.beta1。我遇到了一些小问题,但我可以让应用程序运行并且所有测试都再次通过。问题是当我尝试预编译所有资产以进行部署时,出现以下错误:

vagrant@precise64:/vagrant$ RAILS_ENV=production bundle exec rake assets:precompile
rake aborted!
No such file to load -- bootstrap_flash_helper
/vagrant/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)

这是我的 Gemfile:

source 'https://rubygems.org'

gem 'rails', '4.0.0.beta1'

gem 'pg'
gem 'github_api'
gem 'haml-rails'
gem 'jquery-rails'
gem 'simple_form', github: 'plataformatec/simple_form'
gem 'devise', github: 'plataformatec/devise', branch: 'rails4'
gem 'omniauth'
gem 'omniauth-github'
gem 'rails-backbone', '~> 0.9.10'
gem 'inherited_resources'
gem 'app_configuration'
gem 'unicorn'
gem 'foreman'
gem 'coveralls', require: false

group :assets do
  gem 'sprockets-rails',  github: 'rails/sprockets-rails'
  gem 'coffee-rails',     github: 'rails/coffee-rails'
  gem 'therubyracer',     platforms: :ruby
  gem 'less-rails',       github: 'metaskills/less-rails'
  gem 'twitter-bootstrap-rails'
  gem 'uglifier', '>= 1.0.3'
end

group :development do
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'meta_request'
end

group :test, :development do
  # Debugging
  gem 'pry'
  gem 'debugger'
  gem 'debugger-pry'
  gem 'pry-nav'
  gem 'pry-stack_explorer'

  # Testing
  gem 'timecop'
  gem 'rspec-rails'
  gem 'shoulda-matchers'
  gem 'factory_girl_rails'
  gem 'faker'
  # gem 'cucumber-rails', '~>1.3.0', :require => false
  gem 'database_cleaner', github: 'bmabey/database_cleaner'
end

该项目是开源的(正在进行中),这里是 github 存储库https://github.com/wolox/mgmt

知道我错过了什么吗?

谢谢

4

2 回答 2

1

我有一个类似的问题,然后我发现该组 :assets不再存在。克隆你的仓库后,我从你的 Gemfile 中删除了组 :assets ,然后你的资产预编译好了!

于 2013-03-28T22:36:37.163 回答
0

:assets 组默认不会加载到生产环境中,你可以在你的 config/application.rb ( https://github.com/Wolox/mgmt/blob/master/config/application.rb#L7 in你的回购)

建议的做法是在开发中编译您的资产,然后在您满意之后将 /public/assets 目录推送到生产环境中。

改用这条线,你应该没问题:

RAILS_ENV=development bundle exec rake assets:precompile
于 2013-03-29T18:58:52.013 回答