Install MacVim in Sierra - homebrew

I have a new laptop with Sierra. I brought my applications from my old mac with Time Machine and most of them are working fine. However, Macvim disappeared. I tried to install it.
I tried to re-install it by installing Homebrew and brew installing macvim. The install looks successful, but I still cannot find nor use macvim. I guess this is a matter again of application files no longer being in /usr/ but in Library/, but honestly I am a bit lost as to how to figure out whether this is the problem and how to fix it.
Can you please help me out with this?
How I installed Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
How I installed Macvim:
brew install macvim

MacVim is keg-only.
If you run this command after installation:
brew linkapps
you will find MacVim in your Applications folder in finder.

Since linkapps is now deprecated, I've had to manually link .app via
ln -Fs `find /usr/local -name "MacVim.app"` /Applications/MacVim.app
Unfortunately, Spotlight cannot find MacVim this way. Therefore, I've (after opening the app by double-clicking on the icon in Finder's Applications folder) right-clicked on the app's icon on the dock and selected Option -> Keep in Dock.

The symbolic soft link solution described by #laylaylom works; but I am having trouble setting MacVim as my default app for some filetype. Then I found this from here:
% mkdir ~/Applications/Emacs.app
% ln -s /usr/local/Cellar/emacs/23.2/Emacs.app/Contents ~/Applications/Emacs.app
That solution was for Emacs.app but it can work with MacVim as well:
% mkdir ~/Applications/MacVim.app
% ln -Fs /usr/local/Cellar/macvim/8.1-151/MacVim.app/Contents ~/Applications/MacVim.app

There is now a cask for MacVim, but it's not the default. The correct command is:
brew install homebrew/cask/macvim
This will install MacVim in the Applications folder, and make it available to Spotlight.

Related

Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib

When I try running rails console I get this error:
/Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require':
dlopen(/Users/TuzsNewMacBook/.rvm/rubies/ruby-2.3.7/lib/ruby/2.3.0/x86_64-darwin18/readline.bundle, 9):
Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
A quick search got me to this post and I've tried a few things:
brew reinstall postgresql (this is indeed the DB for this project)
and
cd /usr/local/opt/readline/lib
ln libreadline.8.0.dylib libreadline.6.2.dylib
(my version of readline is 8)
and
brew link readline --force
But none of these have fixed it.
I recently added pry-coolline, guard and guard-livereload gems to my project if that makes any difference (rails console loaded fine before those). I'm running on the latest macos.
(Update) I’m using pry rails as my rails console, if that makes any difference.
Any help? Thanks.
the error seems to be thrown when searching for /usr/local/opt/readline/lib/libreadline.7.dylib.
Have you tried to symlink that?
So something like:
cd /usr/local/opt/readline/lib
ln -s libreadline.8.0.dylib libreadline.7.dylib
Just tried that on macOS Mojave, ruby 2.5.3p105 and Rails 5.2.2 and worked.
Reinstalling my Ruby version seems to have fixed it:
rvm reinstall 2.3.7
can you try
cd /usr/local/opt/readline/lib
ln -s libreadline.8.dylib libreadline.7.dylib
you are on the right track but it seems like rails is looking for libreadline.7.dylib and libreadline.7.dylib is not there in the folder.
Yes, the best answer is to reinstall.
You can get the version easily by typing:
ruby -v
With rbenv, the command is i.e.:
rbenv install 2.3.7
with rvm:
rvm reinstall 2.3.7
A very simple solution that doesn't involve rebuilding your RVM gemset OR sym-linking libraries.
Add to your Gemfile:
gem 'rb-readline'
If you are doing bundler groups
group :development do
gem 'rb-readline'
end
Then run
> bundle
Let me know if that doesn't work.
Most often in Ruby-applications, this is caused by gems that have extensions (the gems saying "Building native extensions.."), that are built using a specific version of, in this case, readline.
Basically, there are two solutions:
Either, you can symlink version 8 of the gem, to the version missing. This will work in many cases, but if backwards compatibility is broken, it will not.
Or, if the gem actually supports version 8, you can reinstall that specific gem, or "pristine" it by running gem pristine --all.
EDIT: In scope of your "what I've tried", reinstalling PostgreSQL, is also one of the binaries, built using a specific version, that may also require a rebuild, to work with a system library, such as readline.
Got this issue:
dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.4.dylib
doing...
cd /usr/local/opt/mpfr/lib/
ln -s libmpfr.dylib libmpfr.4.dylib
did the trick for me for macOS Catalina
Background: This has happened when I tried to install tig, but I think this is a common issue that you may have that you need to manually link the installed software into the right path that another software wants.
If you can not find readline installed on your Mac, you should run
brew install readline
After you installed deadline, brew will ask you to link it. But actually you can not link by running
brew link readline
Even you can not link by running
sudo brew link readline
Mac OS will warn you this is extremely dangerous and stop you to do.
The Latest version of readline is version 8, so you will see the error message like
Library not loaded: /usr/local/opt/readline/lib/libreadline.8.dylib
The brew installed deadline at
/usr/local/Cellar/readline/8.0.4
So you have to manually link it to the place that your software wants by using command ls
ln -s /usr/local/Cellar/readline/8.0.4 /usr/local/opt/readline
Enjoy!
So Ive checked a few answers here but I dont think they can work with a vanilla Mojave mac install. Im using 10.14.4 while I did these:
get homebrew from https://brew.sh
$ brew install coreutils : this installs the gnu coreutils pkg for mac, we want the greadlink from this because macOSX's readlink is not the same as the gnu readlink. Its extremely confusing but such is the life in macland.
$ echo 'alias readlink=greadlink' >> ~/.bash_aliases I found macs readlink to be a bit lacking so I overrode the existing readlink by aliasing greadlink. (you can make this usable by all users by $ alias readlink=greadlink >> /etc/bashrc which will enable every user to be able to use it.
$ ln -s /usr/local/opt/readline/lib/libreadline.8.dylib /usr/local/opt/readline/lib/libreadline.7.dylib I linked the already linked .8. file instead of '.8.0.' file because if it were to get updated to .8.1. then my readlink wont break or miss features on the library. Im pretty sure we will format our macs before 9+ comes out.
I would recommend against manually symlink'ing native libraries. Aas of OS X 10.4, the standard include library path /usr/include is no longer used and is locked by SIP (making it difficult to move things to).
Apple ships a “legacy installer” for you to be able to install the headers in the “old location”, which will also resolve your path to correctly find headers installed via brew.
cp /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg ~/Desktop && open ~/Desktop/macOS_SDK_headers_for_macOS_10.14.pkg`
See here for a detailed write-up on what is going on.
My problem was just the same when running lftp.
Just running brew upgrade has solved my problem, as it has updated (among others):
readline 8.0.0_1 -> 8.0.1
lftp 4.8.4 -> 4.8.4_2

Homebrew error installing tomcat

After installing tomcat on Os x El Capitan using Homebrew I have received the following Warning:
your HOMEBREW_PREFIX is set to /usr/local but HOMEBREW_CELLAR is set
to /usr/local/Cellar. Your current HOMEBREW_CELLAR location will stop
you being able to use all the binary packages (bottles) Homebrew
provides. We recommend you move your HOMEBREW_CELLAR to
/usr/local/Cellar which will get you access to all bottles."
The command brew services list shows no services installed.
Printenv doesn't show any homebrew variable
It's not clear to me what should I do.
enter link description here
I also encountered this problem, in the end of the page to get accurate help,
brew bundle dump
rm -rf /usr/local/Homebrew/Cellar
brew bundle
I have received a similar warning when I tried to do a brew update.
It did not allow me to update. All I have done to resolve it was do a brew update in going to the /usr/local/Cellar directory.
From what I understand HOMEBREW_REPOSITORY path was modified or went missing when the OS was updated. After the brew update, the message said
Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
sudo chown root:wheel /usr/local
This got me back to my normal brew usage with out a problem.

How to set up my Mac for Homebrew?

Hello I downloaded Python from Homebrew but my computer seems to be using the pre installed Apple version.
Is there a way to change this so that my computer can use the Homebrew Python instead?
I read something about bash files on here but I can only see the apple stuff in there. There is nothing in there from usr/local/Cellar.
Because i do not know what you already did and if you installed Homebrew correctly or not i would write out the steps of how you should have done it. I will tell you how to install Homebrew and how to point your package to your path so it locates your python before the Apple python. Also i am assuming you have El Capitan.
1) Download Xcode form App Store if you don't have it.
Steps 2-9 are using Terminal (Applications -> Utilities -> Terminal)
2) Install the command line tools
xcode-select --install
3) Install Homebrew (This will install Homebrew to the root):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
4) Update brew and check with the doctor to fix any issues:
brew update
brew doctor
5) Check if you already have a .bash_profile and if not create it.
a) Check for the .bash_profile
cd $HOME
ls -al
If you see .bash_profile on the list skip (b)
b) Create the bash profile
cd $HOME
touch .bash_profile
7) Export the Path to the bash file:
cd $HOME
echo export PATH=/usr/local/bin:/usr/local/sbin:$PATH >> ~/.bash_profile
source ~/.bash_profile
8) Install your package, for example:
brew install python
9) Run the doctor and fix any issues:
brew doctor
10) Check the Path and make sure that the /usr/local/bin: is before /usr/local/
$PATH
If during the process you get an error saying that you do not have permission add sudo in front of the command and try again.
Hope it helps!

I am getting rvm: command not found after installation of rvm

I know the above question is very common question. I have gone through multiple posts on this topic. But I didn't get any resolution.
I have installed rvm locally. We already have the installation files. SO went into the folder and run the install command.
$ ./install
Then I checked ./rvm folder in the Users home folde
$ cd ~/.rvm
folder exists. Hence Installation is successful.
Now I am typing rvm in the command line
$ rvm
I am getting below exception
$ rvm
-sh: rvm: command not found
After reading the multiple articles in stackoverflow on this issue, I learned that I have to add the below lines in .bash_profile as I am using Mac OSX 10.7.3
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Even after I am getting same exception while typing rvm. Is there any thing extra I need to do? or Am I missing some thing? Please help
Steps to try out:
Log out and login to your system.
Open a new terminal and manually run
source $HOME/.rvm/scripts/rvm
then
rvm
Check these work-arounds.
Update:
To avoid running
source $HOME/.rvm/scripts/rvm
every time you open a terminal, include this line into ~/.MacOSX/environment in your Mac (This is similar to ~/.bashrc in GNU/Linux-based systems under $home aka ~ directory).
In my case, i am using Ubuntu Bash in Windows 10 and to fix the problem i used:
source /usr/local/rvm/scripts/rvm
For those that are doing this in 2018 just
add
source $HOME/.rvm/scripts/rvm
to your .bash_profile within your home directory.
you need to enable login shell in terminal emulator preferences, sometimes it is needed to use /usr/bin/bash --login, here is an example https://rvm.io/integration/gnome-terminal/
after enabling login shell you need to close terminal application and open it fresh.
I just had to open a new Terminal session.
After I installed it using:
curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm install 2.2
For Ubuntu 18.04, I had to run the command below to solve the issue after rvm was installed using instruction from here.
source /usr/share/rvm/scripts/rvm
This is one of other options available for RVM:
source /etc/profile.d/rvm.sh

Getting a "bad interpreter" error when using brew

I'm getting this error when I try to run any brew command.
Holger-Sindbaeks-MacBook-Air:~ holgersindbaek$ brew help
-bash: /usr/local/bin/brew: /usr/bin/ruby: bad interpreter: No such file or directory
I have absolutely no idea on how to fix this and been searching for a long time without answer.
I got this error (much the same):
/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0
and fixed by the solution below:
Open brew.rb:
$ sudo vim /usr/local/Library/brew.rb
Change the first line's 1.8 to Current:
Before:
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
After:
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0
Then brew works for me. Hope it helps if any other one got this issue. :)
If you get the error
Homebrew requires Leopard or higher. For Tiger support, see:
https://github.com/mistydemeo/tigerbrew
change the MACOS check from <10.5 to <10.
Tip by #TimCastelijns:
10.5 doesn't work because in comparison, it's higher than 10.10 (.1 vs .5). I added a check (and MACOS_VERSION != 10.10) instead of lowering from 10.5 to 10.
What you are getting means that Homebrew has not been able to locate the Ruby interpretter at the specified location.
Install Apple Developer Kit (comes with Xcode) which should be available to you as an optional install (or you can simply download it from Apple). This will install the Ruby interpreter for you.
In case you already have Xcode installed, this means that one of these things is happening:
You have a broken Ruby installation
You have more than one Ruby installation
Your installation has not been configured properly.
To identify if this is the first case, you can run ruby and see if you get any response.
If you don't, your installation is broken and you need to reinstall it. If you do, you then run which ruby. This should give you the absolute path to your Ruby executable. If this is anything other than /usr/bin/ruby then homebrew (and a bunch of other programs) will not be able to find it.
In case you have not ever tampered with your Ruby installation, you can check to see if /usr/bin/ruby already exists or not: cat /usr/bin/ruby. If you get No such file or directory, then you can easily create a symbolic link to your Ruby installation. Assuming the output of which ruby to by /usr/local/bin/ruby, you create the symbolic link this way: sudo ln -s /usr/local/bin/ruby /usr/bin/ruby and all should be well.
If there is a file at that location, you can run file /usr/bin/ruby to see if it's a real file, a symbolic link, or a corrupted file. If it is a symbolic link, your installation should be working, and since it's not, it probably is either a corrupted symlink or it's a bogus file.
You can remedy that by first deleting it (sudo rm /usr/bin/ruby) and then creating a new symlink to the correct location (sudo ln -s /usr/local/bin/ruby /usr/bin/ruby).
If non of the above works, you should consult the homebrew team after a clean install of Xcode and removing any traces of a Ruby installation on your system.
EDIT
Alternatively, as pointed out by the other answers, the issue might be because of a bad ruby version in your Homebrew settings.
A quick fix might be updating your Homebrew:
cd /usr/local
git pull -q origin refs/heads/master:refs/remotes/origin/master
If this does not help, you might want to get your hands dirty and manually fix the problem by:
Editing brew.rb from /user/local/Library/brew.rb
Changing /1.8/ to /Current/ in the first line, which will cause the hashbang to point to the current Ruby version as the executor
If this does not help, either, you can also modify the MACOS check and change it from 10.5 to 10 to avoid the infamous "Homebrew requires Leopard or higher" error.
DISCLAIMER
A bunch of thanks to other contributors in the answers below and their commenters. I am not committing plagiarism, simply aggregating the answers into one integrated article to help others.
Fix:
sudo gem install cocoapods
At the risk of oversimplifying things, try running
gem install bundler
I was transitioning my Ruby environment from RBENV to RVM and it worked for me.
This happened because I needed to update brew - in the updated version it already uses Current ruby
cd /usr/local
git pull -q origin refs/heads/master:refs/remotes/origin/master
This solved the problem
You need to change the path for Ruby.Framework
I solved it with commands as mentioned.
brew install cocoapods --build-from-source
brew link --overwrite cocoapods
If you have a lower version below Xcode 11, you have to remove it before you use the above commands.
Reference: Ruby Framework issue
None of the above worked for me, so I kept browsing and found this answer,
https://stackoverflow.com/a/24225960/1359088
which did fix brew for me. He says in step 1 to install XCode 6 command line tools, but doesn't say how; use this command:
xcode-select --install
I got the same issue when updated to MacOSX High Sierra & using Xcode 9 with that. High Sierra update ruby gem to version 2.3 but xcpreety command of Xcode 9 still using Ruby 2.0 which is unable to find now & gives bad interpreter.
Just go to Terminal & run
sudo gem install xcpretty
Restart Xcode & do fresh clean build it works for me.
Hope it helps!!!
After upgrading to macOS High Sierra, get it fixed with following commands:
sudo gem install cocoapods
In my case seems like fastlane installed incorrectly with brew install fastlane system didn't write correct path to fastlane. I fixed it with alias fastlane=~/.fastlane/bin/fastlane
I solved it with commands as mentioned.
1.) Uninstall your GEM.
gem unistall GEM
2.) Then Install your GEM.
sudo gem install GEM -n /usr/local/bin
I got bad interpreter: No such file or directory error when used xcpretty and xcpretty-travis-formatter on upgraded MacOS.
To solve it
gem install xcpretty
gem install xcpretty-travis-formatter
That is why I can recommend you to reinstall failed component gem install <name>
#For example error looks like
/usr/local/bin/xcpretty-travis-formatter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
#use
gem install xcpretty-travis-formatter

Resources