DevHeads.net

Installing ruby with RVM cannot find <CoreFoundation/CFString.h>

Apologies for asking an uninteresting question, I am currently trying to
learn ruby for a senior capstone project by creating a RESTFUL api with it.
I have been trying to install ruby using rvm for a week now and I have had
little success. Both rvm and rbenv complain about not being able to find
CoreFoundation/CFString.h on OSX. I know this is more of a question related
specifically to my machine, but how can I fix my machine? I have posted on
Apple forums, stackoverflow 3-4 times, etc., not sure where else to go from
here.

I am on OSX 10.14.4 with XCode 2.2 installed. More detailed information can
be viewed in the forum posts linked below.

I have homebrew and I am worried about having two versions of ruby
conflicting with it.

Here is my post on apple's forums:

<a href="https://forums.developer.apple.com/thread/115518" title="https://forums.developer.apple.com/thread/115518">https://forums.developer.apple.com/thread/115518</a>

StackOverflow:

<a href="https://stackoverflow.com/questions/55525660/installing-ruby-2-3-1-on-mojave-osx-with-rbenv-or-rvm" title="https://stackoverflow.com/questions/55525660/installing-ruby-2-3-1-on-mojave-osx-with-rbenv-or-rvm">https://stackoverflow.com/questions/55525660/installing-ruby-2-3-1-on-mo...</a>

<a href="https://stackoverflow.com/questions/55618516/installing-ruby-with-rvm-cannot-find-corefoundation-cfstring-h?noredirect=1#comment97930271_55618516" title="https://stackoverflow.com/questions/55618516/installing-ruby-with-rvm-cannot-find-corefoundation-cfstring-h?noredirect=1#comment97930271_55618516">https://stackoverflow.com/questions/55618516/installing-ruby-with-rvm-ca...</a>

I'm having issues right now with multiple ruby versions being installed
(the osx one and the homebrew one I think). For example with rails right
now trying to generate a new model I get:

/usr/local/Cellar/ruby/2.6.2/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in
`warn_for_outdated_bundler_version': *You must use Bundler 2 or greater
with this lockfile. (**Bundler::LockfileError**)*

Yet I have bundler 2.0 installed. Are there any grand master ruby wizards
out there that can give me some guidance.

Basically I just want to ignore the OSX version of ruby (and leave it
unchanged), and manage one using rvm where I can change the version based
on what tutorial I am using (or even just maybe let it stay at the newest
up to date one).

If I type ruby -v I get 2.6.2
But if I generate a new project with rails for an api, the gemfile
automatically goes to 2.3.7 and I have problems.

Thank you,

Nicholas Gallimore

Comments

Re: Installing ruby with RVM cannot find <CoreFoundation/CFStrin

By romanch sharma at 04/11/2019 - 04:47

Hello Nicholas Gallimore,

Seams like you installed ruby with HomeBrew. It's not multiple ruby version. Its Inheritance. Every time you update there will be old code of old ruby version inside it. So Don’t very about it.

Yes you are getting error inside rails because you are not using correct ruby with correct rails version.

I am more of a RVM user, So I can suggest to use RVM for managing ruby by simple commands:

$ rvm install ruby-2.6.2 --default
$ rvm gemset create name_of_project
$ gem gemset use name_of_project
$ gem install bundler
$ gem install rails
$

You can also manage ruby versions form rvmrc file

So that you need not to switch ruby version every time, but latest rvm switch between automatic hence, you can use ramrc file in a much better way.

Always install bundler first then rails for version stability.

I hope your problem get solved by this.

Thank You,
Romanch Sharma
Self Taught :)

Re: Installing ruby with RVM cannot find <CoreFoundation/CFStrin

By Nick Gallimore at 04/11/2019 - 08:56

Thank you all for your help! I was really having a hard time trying to
figure out how to get the header files. This command solves the problem:

open /Library/Developer/CommandLineTools/Packages/
macOS_SDK_headers_for_macOS_10.14.pkg

Also as far as conflicting version of ruby, I uninstalled the one with
homebrew by typing "brew uninstall ruby" then proceeded to install ruby
with "rvm install 6.2.0"

On Thu, Apr 11, 2019 at 5:54 AM romanch sharma < ... at icloud dot com>
wrote:

Re: Installing ruby with RVM cannot find <CoreFoundation/CFStrin

By Gerald Bauer at 04/11/2019 - 03:43

Hello,

Sorry I have no answer. I'd suggest trying a post on the ruby reddit
(see <a href="https://old.reddit.com/r/ruby" title="https://old.reddit.com/r/ruby">https://old.reddit.com/r/ruby</a> ). All the best. Good luck. Happy
coding with ruby (soon).

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Re: Installing ruby with RVM cannot find <CoreFoundation/CFStrin

By Gerald Bauer at 04/11/2019 - 03:53

Hello Nicholas,

I see (from reading the stackoverflow answers) that you're up and
running Why not post the fix here so others know that you're no
longer looking for an answer?. Anyways, just really talking to
myself.

Happy coding with ruby.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>