我在安装响应式活动admin gem时遇到错误。
我正在使用https://github.com/ball-hayden/responsive_active_admin这个宝石进行安装。
捆绑安装工作正常,之后当我刷新网址然后我得到以下错误,我还在config / initializers / active_admin.rb中添加了需要“activeadmin”,但没有解决我的问题,所以请帮助我谢谢提前.. !!
uninitialized constant ActiveAdmin::Views::TabbedNavigation (NameError)
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin/view_factory.rb:7:in `<class:ViewFactory>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin/view_factory.rb:4:in `<module:ActiveAdmin>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin/view_factory.rb:3:in `<top (required)>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin/application.rb:54:in `<class:Application>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin/application.rb:5:in `<module:ActiveAdmin>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin/application.rb:4:in `<top (required)>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin.rb:65:in `application'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/bundler/gems/activeadmin-d787029e5523/lib/active_admin.rb:70:in `setup'
/var/www/html/sites/parking.localhost/config/initializers/active_admin.rb:1:in `<top (required)>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/engine.rb:652:in `block in load_config_initializer'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.4/lib/active_support/notifications.rb:166:in `instrument'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/engine.rb:651:in `load_config_initializer'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/engine.rb:615:in `each'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/engine.rb:615:in `block in <class:Engine>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:420:in `block (2 levels) in each_strongly_connected_component_from'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:419:in `block in each_strongly_connected_component_from'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `each'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/initializable.rb:44:in `tsort_each_child'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:413:in `call'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:413:in `each_strongly_connected_component_from'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `call'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
/home/daffolap-198/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!'
/var/www/html/sites/parking.localhost/config/environment.rb:5:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:110:in `eval'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/home/daffolap-198/.rvm/gems/ruby-2.2.1/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:29:in `<main>'
的Gemfile
source 'https://rubygems.org'
#responsive activeadmin gem
gem 'responsive_active_admin'
gem 'screencap'
#activeadmin for backend interface
gem 'activeadmin', github: 'activeadmin'
gem 'devise'
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.3.20'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
答案 0 :(得分:0)
通过在view_factory.rb中添加require_relative'views',它解决了我的问题。
你可以在activeadmin gem中找到这个文件(/ home / 198 / .rvm / gems / ruby-2.2.1 @ parking / bundler / gems / activeadmin-5536b158bf03 / lib / active_admin`)