gpt4 book ai didi

ruby-on-rails - 安装 rails ActiveAdmin 引擎位于可安装引擎内

转载 作者:行者123 更新时间:2023-12-04 06:03:04 27 4
gpt4 key购买 nike

我试图在可安装的引擎中安装 rails active admin gem,但是当我运行虚拟应用程序服务器时遇到以下错误 -

     /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:25:in `stat': No such file or directory - /mycode/testingengine/app/admin (Errno::ENOENT)
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:25:in `block in updated_at'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:25:in `map'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:25:in `updated_at'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:29:in `execute_if_updated'
from /.rvm/gems/ruby-1.9.2-p290/gems/activeadmin-0.3.3/lib/active_admin/reloader.rb:22:in `block in attach!'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:404:in `_run_prepare_callbacks'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/reloader.rb:46:in `prepare!'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /mycode/testingengine/config/environment.rb:5:in `<top (required)>'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:83:in `require_environment!'
from /.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:22:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

任何人都知道如何解决这个问题?我在父可挂载引擎目录中运行了 rails g active_admin:install ,并且文件夹/mycode/testingengine/app/admin 确实存在于默认仪表板文件中,所以我不确定从哪里开始。非常感谢任何帮助!

最佳答案

终于想通了。在您的 ActiveAdmin.setup 初始化程序块中添加以下内容。

    config.load_paths.delete_at(0)
config.load_paths << "#{Cms::Engine.root}/app/admin/"

请务必将 Cms 替换为您的引擎名称。现在它不会尝试使用您的引擎文件夹从应用程序加载 activeadmin。

关于ruby-on-rails - 安装 rails ActiveAdmin 引擎位于可安装引擎内,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8718176/

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