0

我正在尝试在 Heroku 上运行 db:migrate (应用程序在本地运行良好),但出现此错误:

rake aborted!
uninitialized constant Bootstrap::Rails::Engine::Sass
/app/vendor/bundle/ruby/2.0.0/bundler/gems/bootstrap-rails-8eb1287f94b3/lib/bootstrap-rails/engine.rb:6:in `block in <class:Engine>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

宝石文件:

source 'https://rubygems.org'
ruby "2.0.0"

gem 'rails', '4.0.0'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  #gem 'therubyracer'
  #gem 'less-rails'
  #gem 'twitter-bootstrap-rails'
  gem 'uglifier', '>= 1.0.3'
end

gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails',
                              :github => 'anjlab/bootstrap-rails',
                              :branch => '3.0.0'

gem 'railties', '>=4.0.0'
gem 'protected_attributes'

gem 'jquery-rails'
gem 'foreman'
# PostgreSQL
gem 'pg'

# Use Unicorn as the app server
gem 'unicorn'

# Devise for user accounts management
gem 'devise'

# Stripe for processing payments
gem 'stripe'

# New Relic monitoring
gem 'newrelic_rpm'

# QR Code generation
gem 'rqrcode-rails3'

# User auth
gem 'cancan'

group :development do
  gem 'debugger'
  gem 'better_errors'
  gem "binding_of_caller"
  gem 'meta_request'  
end
4

1 回答 1

1

删除资产组,因为它不再存在于 Rails4 中。

只需将其中包含的宝石移动到全局空间中

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  #gem 'therubyracer'
  #gem 'less-rails'
  #gem 'twitter-bootstrap-rails'
  gem 'uglifier', '>= 1.0.3'
end

# becomes

# group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby
  #gem 'therubyracer'
  #gem 'less-rails'
  #gem 'twitter-bootstrap-rails'
  gem 'uglifier', '>= 1.0.3'
# end
于 2013-07-29T10:46:12.700 回答