Require command not working within bash irb on Snow Leopard

♀尐吖头ヾ 提交于 2019-12-01 03:50:42
Mischa

This is because the working directory is no longer in the Ruby path in Ruby 1.9.2. This does work:

require './ex25'
Rob Sobers

This is actually a mistake on my part when I was writing the exercise. @mischa is spot on with his solution, but you'll notice as you progress through the book that subsequent exercises use the require_relative command instead of require.

The various methods for ensuring that your working directory is in the load path are described here, but I suggest you pick one and remain consistent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!