我试图部署在我的VPS我的Rails应用程序,但我得到了/var/log/httpd/error_log
的错误说Rails的:阿帕奇:乘客:循环依赖错误,A DeviseController(RuntimeError)
`Circular dependency detected while autoloading constant DeviseController (RuntimeError)
/home/user/.gem/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:509:in 'load_missing_constant'
/home/user/.gem/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:203:in 'const_missing'
/home/user/.gem/ruby/2.4.0/gems/devise-4.2.1/app/controllers/devise/registrations_controller.rb:1:in '<top (required)>'....`
我已搜查谷歌和必应并且无处可去。我也不完全明白这个错误。创建一个基础导轨应用程序,它的工作。推测说全系统都很好。设计宝石安装在系统上并运行bundler install
,没有错误。还运行rake db:migrate
将所有内容安装到数据库中。我怀疑系统上的一切正常,但在我的应用程序中的东西是错误的,或者我需要在设计中添加一些东西,但是什么?
在我的应用程序中,它非常简单。该应用程序允许人们注册和登录。我不使用邮件功能,它只有设计使用的标准user
成员资格。没有在设计中设置管理员角色。它的所有默认配置。
万一我的Apache配置是
`<VirtualHost myapp.tk:80>
ServerName myapp.tk
ServerAlias www.myapp.tk
DocumentRoot "/srv/http/myapp/public"
ErrorLog "/var/log/httpd/myapp.tk-error_log"
CustomLog "/var/log/httpd/myapp.tk-access_log" common
PassengerRuby /usr/bin/ruby
RailsEnv production
<Directory "/srv/http/myapp/public">
Allow from all
Options -MultiViews
Require all granted
</Directory>
</VirtualHost>`
的服务器设置上的Archlinux运行Apache /乘客。所有的都是最新的版本,包括宝石。
让我知道是否我错过了任何需要的日志文件或信息。看似简单的问题,但
对不起,但是我会添加这些行的文件或文件? – deskmonkey
您可以将此第一行添加到'config/application.rb' –
谢谢您的回复。我将它添加到文件中,然后重新启动应用程序'touch tmp/restart.txt'并重新启动apache,但仍然没有任何更改就出现错误。 – deskmonkey