Rails生成不起作用

时间:2017-11-03 16:38:53

标签: ruby-on-rails ruby activeadmin

我是rails的新手,必须支持新项目,对这个愚蠢的问题感到抱歉。

我需要在主站点上创建新页面,而不是在管理面板中,尝试“rails generate controller Impulse index”,就像在tutotial中一样,但是得到了错误:

/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:80:在`救援中阻止(2级)在''中:尝试加载宝石'activeadmin'时出错。 (捆扎机:: GemRequireError)

完全错误

  

/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:80:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'activeadmin'. (Bundler::GemRequireError) from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:76:in块(2级)in require'           来自/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in each' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in阻止在'需要'           来自/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in each' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in require'           来自/usr/lib/ruby/vendor_ruby/bundler.rb:99:in require' from /home/deploy/20171102/staytrue/config/application.rb:7:in'           来自/var/lib/gems/2.3.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:141:in require' from /var/lib/gems/2.3.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:141:in require_application_and_environment!'           来自/var/lib/gems/2.3.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:128:in generate_or_destroy' from /var/lib/gems/2.3.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:50:in generate'           来自/var/lib/gems/2.3.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in run_command!' from /var/lib/gems/2.3.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in'           来自bin / rails:8:require' from bin/rails:8:in'

1 个答案:

答案 0 :(得分:0)

按照以下步骤操作:

  1. 删除gemfile.lock(rm Gemfile.lock

  2. 删除activeadmin gem(gem uninstall activeadmin

  3. 捆绑安装/更新

  4. 用于测试irb / rails c:

    require 'activeadmin'