Rails:遵循 rolify 教程但在 Ruby 解释器中遇到错误
Rails: following rolify tutorial but encountered a bug in the Ruby interpreter
gem 'devise', '~> 4.2'
gem 'rolify', '~> 5.1'
gem 'cancancan', '~> 1.15'
rails 5.0
ruby2.3.0
我正在按照 rolify 教程学习 rolify。 https://github.com/RolifyCommunity/rolify/wiki/Devise---CanCanCan---rolify-Tutorial
我完全按照教程指示完成了每一步。安装和配置后,当我在控制台中移动到 usage 和 运行 user = User.new
时,它向我显示了数千行这样的错误。谁能告诉我如何解决这个问题?
1681 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/extend-command.rb
1682 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/output-method.rb
1683 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/notifier.rb
1684 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/slex.rb
1685 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/ruby-token.rb
1686 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/ruby-lex.rb
1687 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/src_encoding.rb
1688 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/magic-file.rb
1689 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/input-method.rb
1690 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/locale.rb
1691 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb.rb
1692 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb
1693 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb
1694 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console.rb
1695 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/console/app.rb
1696 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/console/helpers.rb
1697 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/psych/y.rb
1698 /Users/Cy/.rvm/scripts/irbrc.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
我发现可能是Spring Gem触发的bug。
所以我的解决方案是在rails c
之前输入spring stop
或者如果您不需要,只需删除 Gem 文件中的 gem spring
。
试试吧!
在这里你可以找到更多关于它的信息:
gem 'devise', '~> 4.2'
gem 'rolify', '~> 5.1'
gem 'cancancan', '~> 1.15'
rails 5.0
ruby2.3.0
我正在按照 rolify 教程学习 rolify。 https://github.com/RolifyCommunity/rolify/wiki/Devise---CanCanCan---rolify-Tutorial
我完全按照教程指示完成了每一步。安装和配置后,当我在控制台中移动到 usage 和 运行 user = User.new
时,它向我显示了数千行这样的错误。谁能告诉我如何解决这个问题?
1681 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/extend-command.rb
1682 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/output-method.rb
1683 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/notifier.rb
1684 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/slex.rb
1685 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/ruby-token.rb
1686 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/ruby-lex.rb
1687 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/src_encoding.rb
1688 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/magic-file.rb
1689 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/input-method.rb
1690 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/locale.rb
1691 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb.rb
1692 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb
1693 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb
1694 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console.rb
1695 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/console/app.rb
1696 /Users/Cy/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/console/helpers.rb
1697 /Users/Cy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/psych/y.rb
1698 /Users/Cy/.rvm/scripts/irbrc.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
我发现可能是Spring Gem触发的bug。
所以我的解决方案是在rails c
spring stop
或者如果您不需要,只需删除 Gem 文件中的 gem spring
。
试试吧!
在这里你可以找到更多关于它的信息: