RoR: Fail on 'gem install mysql2' on Mac - ruby-on-rails

I am on OS X Yosemite (10.10.3)
I have installed mysql via Homebrew
I get the following error when I run bundle on my project

My recent upgrade to yosemite might be causing the problem. I had xcode version 6.3, which I downgraded to 6.2 and tried bundle and it worked!

Related

Uninstalling and Re-Installing homebrew on the Mac

MacOS: Ventura 13.1
I have several packages on my Mac installed using Homebrew. I am dealing with a situation, following the update to Ventura 13.1, where the only solution may be to uninstall and re-install Homebrew.
What are my options, if I want to make sure all the tools/apps I installed using Homebrew are re-installed when the process is done?
It should be as simple as:
brew bundle dump
which creates a Brewfile of all your taps and packages, followed by:
brew bundle
which reinstalls everything you had before from the Brewfile.

Issue with install xcode while installing ruby, rails and postgresql on macOS Big Sur 11.2.3

UPDATES
I'm having some issues on a new mac m1 and my install of ruby, rails, xcode and postgresql
First attempt:
##What I did ?
Installing homebrew, ruby, rails, postgresql
OS: macOS Big Sur Version 11.2.1 (20D74)
zsh: 5.8 (x86_64-apple-darwin20.0)
postgres: 13.2
Rails version: Rails 6.1.3
Ruby version: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
Brew version: Homebrew 3.0.9
What I could do:
I have successfully:
create a rails app with rails new myApp -d postgresql
add gem devise to the Gemfile
run bundle install
create devise User and all CRUD views
run db:create, db:migrate
launch the server with rails s
access all the pages of login, sign up, etc...
Expected behavior
I'm expecting to be able to create an account and connect to it on the app.
Actual behavior
When I try to create an account I'm running into an error about the gem bcrypt that seems to run on the wrong architecture...
Second attempt:
I've uninstall ruby, rails, rbenv, postgresql, homebrew
I've update my OS version to: macOS Big Sur 11.2.3
I'm following this tutorial:
gorails.com/setup/osx/11.0-big-sur
Brew version: Homebrew 3.0.11
rbenv version: rbenv 1.1.2
ruby versions:
2.7.2 (set by /Users/lucas-illiano/.ruby-version)
3.0.0 (I can't put the 3.0.0 version to global...)
rails version: 6.1.1
I've deleted rbenv before deleting all ruby versions on the system ? Is that why ?
At the end of the tutorial, before installing postgresql, it says to install this package macOS_SDK_headers_for_macOS_10.14.pkg
But I'm running into an issue about x-code and CommandLineTools install.
I've tried to download the package from here developer.apple.com/download/more I cannot get the folder /Library/Developer/CommandLineTools/
I've also tried xcode-select --install but x-code is already well install. No upgrade available.
I can't think of any other way to install successfully this package.
Anyone have an idea about the issue installing xcode and CommandLineTools on MacOS Big Sur?
Thanks by advance and have a good day to you all.
Not sure if this will help you. If you were able to run the server then xcode, and other things are probably good already.
I am not much into Ruby/Rails now but from what I understand. Some gems are not supported for Apple M1 arch yet. If you're getting an error similar to missing compatible arch then using arch -arch x86_64 before the command may help.
In my case, where I was running another gem - Jekyll, using arch -arch x86_64 solved my problem.
> bundle exec jekyll build --> failed with arch error
But,
> arch -arch x86_64 bundle exec jekyll build --> works just fine

Reinstalling Xcode on Mountain Lion after upgrading from Lion

I'm running OSX 10.8. My Mac had Snow Leopard when I got it, but I have since upgraded to Lion and then Mountain Lion. I'm trying to get my Ruby on Rails environment set up, and when I run Homebrew's "brew doctor" command, I get this:
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please install the CLT or Xcode 5.0.1.
Warning: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
So I uninstalled and reinstalled Xcode (now have v 5.0.2) and the command line tools, and I'm still getting the same messages. I've tried doing:
sudo /Developer/Library/uninstall-devtools --mode=xcodedir
But I get this in response:
sudo: /Developer/Library/uninstall-devtools: command not found
Thanks in advance for any help.
Try which gcc to figure out which gcc you are using.
Then run which -a gcc to see all the gcc's that you have installed.
You'll probably find that you're using the osx version and that changing your path ordering in shell config, eg. bash.rc will fix this brew doctor error.

How to use RVM to install Ruby 1.9.3 when Xcode 4.3.2 is installed and gcc is missing?

I got a new iMac with Lion and installed Xcode 4.3.2. After running
curl -L get.rvm.io | bash -s stable
I opened up a new bash, and used
$ rvm install 1.9.3
to install Ruby 1.9.3, but there were errors and the log said that the C compiler is not there. And rvm requirements says:
$ rvm requirements
[...]
Xcode 4.3+ users
- please be warned
- only ruby-1.9.3-p125+ is partially supported
- in case of any compilation issues:
* downgrade to Xcode 4.1
* uninstall Xcode and install osx-gcc-installer
and reinstall your rubies.
So does that mean I might need to downgrade to Xcode 4.1? What if I want to keep Xcode 4.3.2? Then will 1.9.3-p125+ be able to work, but only partially?
Update: or how about installing Ruby 1.9.2 -- will it work with the latest Rails 3.2.3? If so, how to add gcc? (using Xcode's gcc?)
To install 1.9.2 or lower you need to follow the instructions in this blog post. It outlines how it get a copy of GCC which does not conflict with Xcode but can be used to build Ruby.
Xcode 4.3, Homebrew and Ruby.
You cannot install the osx-gcc-installer as it will conflict with Xcode 4.3.2, overwriting the working versions of llvm-gcc and clang.
install osx-gcc-installer
use latest ruby:
rvm install ruby
it will be 1.9.3-p125 as it's latest ruby

can we install xcode_3.2.5_and_ios_sdk_4.2_final on Lion

Hello I have Lion in my mac airbook, I want to install xcode_3.2.5 on that, I installed it but it is unable to install.
Mount xcode325.dmg. Open terminal and type following commands:
export COMMAND_LINE_INSTALL=1
open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"
It should install successfully then.
You have to install it from Snow Leopard, but it will then run on Lion. So, for example, boot from an external Snow Leopard disc and run the installer from there.
check it your xcode installation is for what version lion snow leopard.
As per knowledge in lion OS you have to direct install xcode from Apple APP STORE.

Resources