Skip to content

twilio-ruby 6.0 mangles .rbenv path #655

@broksonic21

Description

@broksonic21

Issue Summary

When using 6.0 in an rbenv/bundler setup, this line:

require file.gsub('.rb', '_base.rb') unless file.end_with?('client.rb') || file.end_with?('_base.rb')

mangles paths and thus twilio-ruby can't be used as require "twilio-ruby"

This is because a path like this:

/Users/REDACTED/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/twilio-ruby-6.0.0/lib/twilio-ruby/rest/accounts.rb

gets turned into

/Users/REDACTED/.base_rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/twilio-ruby-6.0.0/lib/twilio-ruby/rest/accounts_base.rb

where the .rbenv gets modified into .base_rbenv (when the actual goal was just the filename getting that sub)

Steps to Reproduce

  1. use rbenv
  2. install twilio-ruby
  3. require 'twilio-ruby' ---> it fails

Code Snippet

n/a

Exception/Log

/Users/REDACTED/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/twilio-ruby-6.0.0/lib/twilio-ruby/rest/accounts.rb
Traceback (most recent call last):
/Users/REDACTED/.rbenv/versions/2.7.8/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:37:in `require': cannot load such file -- /Users/REDACTED/_base.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/twilio-ruby-6.0.0/lib/twilio-ruby/rest/accounts_base.rb (LoadError)

Technical details:

  • twilio-ruby version: 6.0.0
  • ruby version: ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [arm64-darwin22]
  • rbenv version: rbenv 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions