我正在使用Travis CI进行Ruby on Rails应用程序,并且我的构建成功并推送到Heroku。当我尝试在Heroku上检查端点时,出现应用程序错误。LoadError:无法加载这样的文件 - Heroku上的Travis Ruby on Rails
我所做的调查问题是从我的应用程序的根运行heroku rake db:migrate --app AppNameHere
,并填充下面的错误:
Running rake db:migrate on lawville... up, run.9338 (Free)
rake aborted!
LoadError: cannot load such file -- travis
/app/config/application.rb:11:in `require'
/app/config/application.rb:11:in `<top (required)>'
/app/Rakefile:4:in `require'
/app/Rakefile:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
应用程序/配置/ application.rb中(注11行从错误是'需要“特拉维斯”)
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'active_model/railtie'
require 'active_job/railtie'
require 'active_record/railtie'
require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'action_view/railtie'
require 'sprockets/railtie'
require 'travis'
require 'nokogiri'
require 'carrierwave'
require 'simple_form'
require 'social-share-button'
require 'redactor-rails'
require 'devise'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module LawVille
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
end
end
特拉维斯建设(在什么情况下可以摆脱光解决我的问题)
https://travis-ci.org/AfolabiOlaoluwa/LawVille/builds/166891343
我的application.rb中的内容适用于开发。
我能做些什么来解决这个问题?提前致谢。
@HunterTChapman,但尽管我删除了所有必需的宝石,我的本地应用程序也就崩溃了。 –
是的,这很有趣。你可以走拼凑路线。尝试__这些: '''需要'travis'如果ENV ['RACK_ENV'] =='development''''' '''require'travis'unless Rails.env.production?''' – BootCoder