gpt4 book ai didi

ruby-on-rails - # 的未定义方法 `assets'

转载 作者:太空宇宙 更新时间:2023-11-03 16:21:35 26 4
gpt4 key购买 nike

我目前正在尝试将我的 Rails 3.2.17 应用程序部署到 Heroku 的 cedar-14 堆栈。

我在运行 git push heroku master 时收到错误消息。这是相关的输出:

remote:        Bundle completed (141.81s)
remote: Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: Could not detect rake tasks
remote: ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
remote: and using the production group of your Gemfile.
remote: rake aborted!
remote: NoMethodError: undefined method `assets' for #<Rails::Railtie::Configuration:0x007f1e3f3dd998>
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/railties-3.2.17/lib/rails/railtie/configuration.rb:85:in `method_missing'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/gritter-1.2.0/lib/gritter/railtie.rb:7:in `<class:Railtie>'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/gritter-1.2.0/lib/gritter/railtie.rb:3:in `<module:Gritter>'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/gritter-1.2.0/lib/gritter/railtie.rb:2:in `<top (required)>'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/gritter-1.2.0/lib/gritter.rb:26:in `<top (required)>'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `each'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:72:in `block in require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `each'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:61:in `require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/bundler-1.9.7/lib/bundler.rb:134:in `require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/config/application.rb:13:in `<top (required)>'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/Rakefile:5:in `require'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/Rakefile:5:in `<top (required)>'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in `load_rakefile'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:689:in `raw_load_rakefile'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:94:in `block in load_rakefile'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:93:in `load_rakefile'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:77:in `block in run'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
remote: /tmp/build_9c69b395977c833063f1bf84ce228ae8/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
remote: vendor/bundle/bin/rake:16:in `load'
remote: vendor/bundle/bin/rake:16:in `<main>'
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote: Default types for Ruby -> console, rake, worker
remote:
remote: -----> Compressing... done, 58.6MB
remote: -----> Launching... done, v5
remote: https://alliance-billing-dev.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.
To https://git.heroku.com/alliance-billing-dev.git
* [new branch] master -> master

运行 bundle exec rake -P 提供类似的输出。我已经阅读了几篇与未找到 Assets 方法相关的类似帖子,但所有这些帖子似乎都与我没有使用的 gem 有关。

我的猜测是我的一个 gem 和 rails 存在兼容性问题。根据其他帖子,有问题的 gem 似乎总是在回溯中位于 rails 之前的 gem。这会让我相信 gritter-1.2.0 是罪魁祸首。但是,我不知道如何从那里开始,或者我的假设是否正确。

这是我的 Gemfile 的内容,以防万一可以帮助找到解决方案。

source 'https://rubygems.org'
ruby '2.1.7'
gem 'rails', '3.2.17'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'pg'
gem 'sendgrid'
gem 'newrelic_rpm'
gem 'unicorn'
gem 'money-rails'
gem 'rack-timeout'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'compass-rails'

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

gem 'uglifier', '>= 1.0.3'
end


gem 'activerecord-import'
gem 'bootstrap-sass'
gem 'cancan'
gem 'carrierwave'
gem 'chosen-rails'
gem 'chronic'
gem 'client_side_validations'
gem 'client_side_validations-simple_form'
gem 'date-input-rails'
gem 'default_value_for', git: 'git://github.com/malagoli/default_value_for.git', ref: '3d458733a2'
gem 'fog'
gem 'gritter'
gem 'haml'
gem 'heroku'
gem 'holidays', git: 'git://github.com/braintreeps/holidays.git'
gem 'jquery-rails'
gem 'kaminari'
gem 'less-rails'
gem 'paper_trail', '~> 3.0.0'
gem 'postgres-copy'
gem 'prawn', '~> 1.0.0rc2'
gem 'quiet_assets', :group => :development
gem 'rails-asset-jqueryui'
gem 'ransack', git: 'git://github.com/ernie/ransack.git'
gem 'simple_form'
gem 'sorcery'
gem 'strong_parameters'
gem 'tabs_on_rails', git: 'git://github.com/xn/tabs_on_rails.git'
gem 'therubyracer'
gem 'twitter-bootstrap-rails'

group :development do
gem 'taps', :require => false # has an sqlite dependency, which heroku hates\
gem 'sqlite3'
end

group :development, :test do
#gem 'capybara'
#gem 'cucumber-rails', :require => false
gem 'annotate'
gem 'factory_girl_rails'
gem 'haml-rails'
gem 'launchy'
gem 'pry-rails'
gem 'rspec-rails'
gem 'shoulda', :require => false
end

group :test do
#gem 'capybara-firebug', :require => false
gem 'database_cleaner'
end

group :production do
gem 'rails_12factor'
end

提前感谢您的帮助。

最佳答案

我确定原因是删除了我的 Gemfile.lock。在推送到 Heroku(并运行 bundle install)之前,我在对 gem(调试器 1.6.8)的安装进行故障排除时删除了我的 Gemfile.lock。

新的 Gemfile.lock 与原来的有很多不同之处,这肯定会导致错误。通过回滚并使用原始 Gemfile.lock 解决了问题。

关于ruby-on-rails - #<Rails::Railtie::Configuration:0x000000056ac200> 的未定义方法 `assets',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32389619/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com