2017-02-12 24 views
7

Tôi mới dùng đường ray và cố gắng thêm quản trị viên hoạt động trên phiên bản mới nhất của ruby ​​2.3.0 và rails5. tôi đã thêm vào dưới dòng trong tập tin đá quý:Rails 5 vấn đề cài đặt quản trị hoạt động

gem 'inherited_resources', github: 'activeadmin/inherited_resources' 
gem 'activeadmin', github: 'activeadmin' 

đã bó cài đặt và sau đó tôi chạy máy chủ và tôi đang nhận được báo lỗi dưới đây:

C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/bundler/gems/inherited_resources-6fa6e5b9d29c/lib/inherited_resources.rb:30:in `block in <top (required)>': break from proc-closure (LocalJumpError) 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `instance_eval' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `execute_hook' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:49:in `each' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.1/lib/action_controller/api.rb:145:in `<class:API>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.1/lib/action_controller/api.rb:88:in `<module:ActionController>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/actionpack-5.0.1/lib/action_controller/api.rb:5:in `<top (required)>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/jbuilder-2.6.1/lib/jbuilder/railtie.rb:20:in `block (2 levels) in <class:Railtie>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `instance_eval' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:43:in `execute_hook' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:33:in `block in on_load' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:32:in `each' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/lazy_load_hooks.rb:32:in `on_load' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/jbuilder-2.6.1/lib/jbuilder/railtie.rb:19:in `block in <class:Railtie>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `instance_exec' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `run' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:55:in `block in run_initializers' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `call' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/initializable.rb:54:in `run_initializers' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/application.rb:352:in `initialize!' 
     from C:/Sites/second_project/config/environment.rb:5:in `<top (required)>' 
     from C:/Sites/second_project/config.ru:3:in `require_relative' 
     from C:/Sites/second_project/config.ru:3:in `block in <main>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize' 
     from C:/Sites/second_project/config.ru:in `new' 
     from C:/Sites/second_project/config.ru:in `<main>' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/server.rb:59:in `app' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/server.rb:124:in `log_to_stdout' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/server.rb:77:in `start' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 
     from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 

Tôi google những lỗi nhưng có vẻ như mã lỗi tuy nhiên tôi đã không viết bất kỳ mã nào trong dự án mới được tạo ra chỉ cần cố cài đặt quản trị hoạt động để thực hành. Hãy giúp tôi sắp xếp việc này.

Trả lời

5

Điều này là do recent bug. Chỉ cần sử dụng phiên bản mới nhất từ ​​RubyGems chứ không phải GitHub. Nếu bạn bỏ qua inherited_resources từ Gemfile của bạn, điều này sẽ được thực hiện cho bạn theo mặc định.

2

Dưới đây là những gì tôi sẽ sử dụng trong Gemfile tôi:

gem 'activeadmin', github: 'activeadmin' 
gem 'inherited_resources' 

Nhìn vào kho github 'inherited_resources', có vẻ thích phiên bản hiện tại trong repo là bị hỏng. Cách tốt nhất là cố gắng sử dụng các phiên bản đá quý mà bạn có thể kiểm soát (cuộc gọi ở trên thậm chí không thực sự sạch cho ứng dụng sản xuất)

Bạn cũng có thể gặp phải một số lỗi SSL sau đó vào Gemfile của bạn

gem 'openssl', '>=2.0.3' 
+0

lỗi khi mở openssl, *** extconf.rb không thành công *** Không thể tạo Makefile do một số lý do, có thể thiếu các thư viện và/hoặc tiêu đề cần thiết . Kiểm tra tệp mkmf.log để biết thêm chi tiết. Bạn có thể cần các tùy chọn cấu hình. –

Các vấn đề liên quan