I have a ruby file that does not have a .rb
extension, and is instead identified as ruby code with a shebang at the beginning of the file: #!/usr/bin/env ruby
. I want to require
the code in this file in another ruby file, but it seems to be having a problem because require
automatically appends the .rb
extension to the files it looks for. Is there any way to suppress this behavior and make require only look for the file as the name is given?
相关问题
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
- reference to a method?
- ruby 1.9 wrong file encoding on windows
- gem cleanup shows error: Unable to uninstall bundl
相关文章
- Ruby using wrong version of openssl
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- “No explicit conversion of Symbol into String” for
- Segmentation fault with ruby 2.0.0p247 leading to
- How to detect if an element exists in Watir
- uninitialized constant Mysql2::Client::SECURE_CONN
- ruby - simplify string multiply concatenation
We have scripts the users are allowed to call, which are accessed using symlinks. The symlinks exist in our /usr/local/bin directory, which is automatically included in their path via a minor adjustment to /etc/profile.
Our real scripts exist in a separate directory using the normal Ruby name, ending with ".rb". We can access those using
require
if necessary.Use
load
instead: