Usage of ~ (tilde) changed in Ruby or Rails?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Usage of ~ (tilde) changed in Ruby or Rails?

Ralph Shnelvar
Usage of ~ (tilde) changed in Ruby or Rails? I am migrating some code from Rails 4 to Rails 5.


My current environment is:
Rails 5.2.0
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]


In my previous Rails 4 environment during initialization when environment.rb is being loaded I could require a file and in that file I had
 require '~/app/models/ralph_lib/ralph_sql'
and the file would load.

Now, when I invoke webrick, I get the error
 /home/mydomain/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- ~/app/models/ralph_lib/ralph_sql (LoadError)

If, instead, I use
 require '/home/mydomain/app/models/ralph_lib/ralph_sql'
or
 require_relative '../app/models/ralph_lib/ralph_sql'
then ralph.sql loads successfuly

Am I overlooking some initialization in order to get tilde to work?

Ralph Shnelvar

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7710014882.20180802084315%40dos32.com.
For more options, visit https://groups.google.com/d/optout.