gpt4 book ai didi

ruby-on-rails - Rails 4.1:Rails:Module的未定义方法 `application'

转载 作者:行者123 更新时间:2023-12-02 14:37:26 24 4
gpt4 key购买 nike

因此,我试图在Hostgator上托管Rails 4.1,并且在设置rake db:migrate后在远程rails目录中运行database.yml时遇到以下错误:

WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)'    instead.
at /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `application' for Rails:Module
/home2/flsintl/public_html/dev/fls/config/initializers/filter_parameter_logging.rb:4
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:622:in `load_application_initializers'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `load_application_initializers'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:176:in `process'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `send'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
/home2/flsintl/public_html/dev/fls/config/environment.rb:9
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/tasks/misc.rake:4
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => db:migrate => environment

我认为这可能是在说rails-2.3.18,即使我的rails 4.1在Gemfile中(或者在我开发应用程序时是我本地计算机上的版本)。但是我仍然对如何做感到困惑。

这是我的Gemfile:
 source 'https://rubygems.org'

gem 'rails', '4.0.4'

gem 'haml'
gem 'haml-rails'
gem 'bootstrap-sass', '~> 3.1.1'

gem 'sqlite3'

gem 'sass-rails', '~> 4.0.2'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.0.0'


gem 'stripe', :git=> 'https://github.com/stripe/stripe-ruby'

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 1.2'

group :doc do
gem 'sdoc', require: false
end

最佳答案

不幸的是,截至目前,Hostgator服务器环境不支持rails 4 applications(并且要启动并运行Rails 3应用程序很痛苦)。您将不得不修改您的应用程序以使其与Rails 2.3.8(与ruby 1.8.7兼容),或寻求更灵活的托管选项。 (几个月前我经历了同样的事情...)

关于ruby-on-rails - Rails 4.1:Rails:Module的未定义方法 `application',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25193159/

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