johnfairh / RubyGateway

Embed Ruby in Swift: load Gems, run scripts, call APIs seamlessly in both directions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ruby version problem

alekzernov opened this issue · comments

I have swift project. в нем $LOAD_PATH :
/Library/Ruby/Site/2.6.0
/Library/Ruby/Site/2.6.0/x86_64-darwin20
/Library/Ruby/Site/2.6.0/universal-darwin20
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/x86_64-darwin20
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin20
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/x86_64-darwin20
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20
In termenal
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/x86_64-darwin20
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/vendor_ruby/2.7.0
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/vendor_ruby/2.7.0/x86_64-darwin20
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/vendor_ruby
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0
/Users/alexandr/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-darwin20

How to make it fashionable to look from the ruby ​​project in the same place and from the terminal?

They are different because Xcode does not see the RVM overrides done in .bash_profile.

I assume you are using Xcode with an .xcodeproj, and you want Xcode to use RVM Ruby 2.7?

You need to set Xcode flags to point to your RVM Ruby, see here leading to here.

It's pretty messy - I don't know how to make it easier to do in Xcode 😢

Closing, answered.