Homebrew path issue - homebrew

How do I fix this path issue? I can't use brew command and I think I previously symlink to wrong location.
Master:~ shaunstanislaus$ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press enter to continue
==> Downloading and Installing Homebrew...
remote: Counting objects: 82368, done.
remote: Compressing objects: 100% (39323/39323), done.
remote: Total 82368 (delta 56782), reused 65301 (delta 42220)
Receiving objects: 100% (82368/82368), 11.68 MiB | 1.59 MiB/s, done.
Resolving deltas: 100% (56782/56782), done.
From https://github.com/mxcl/homebrew
* [new branch] master -> origin/master
HEAD is now at 2ea1a0e smpeg: depends on gtk
==> Installation successful!
You should run `brew doctor' *before* you install anything.
Now type: brew help
Master:~ shaunstanislaus$ brew doctor
-bash: /usr/local/bin/brew: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
Master:~ shaunstanislaus$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/shaunstanislaus/Library/Application Support/GoodSync:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/Users/shaunstanislaus/.ec2/bin:/Users/shaunstanislaus/.rvm/bin
/usr/local/bin/brew: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory

Not everyone keeps the default system version of ruby. Many will rename this file and use the MacPorts ruby, or compile it by hand, in which case it may be in a different location.
I recommend changing this so that it will look for the ruby executable in a different location if it's not in the default.
Visit http://linguisticlogic.wordpress.com/2010/11/27/homebrew-mac-osx-and-ruby/
just doing
sudo ln -s /opt/local/bin/ruby /usr/bin/ruby
may work !!!

Related

Why is STS Cask not available for macOS?

I tried to install Spring Tool Suite on macOS Mojave using brew cask install sts (which i found while googling), but apparently it is not available:
brew cask install sts
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 3580, done.
remote: Counting objects: 100% (3580/3580), done.
remote: Compressing objects: 100% (3572/3572), done.
remote: Total 3580 (delta 23), reused 592 (delta 6), pack-reused 0
Receiving objects: 100% (3580/3580), 1.20 MiB | 1.25 MiB/s, done.
Resolving deltas: 100% (23/23), done.
Checking out files: 100% (3560/3560), done.
Tapped 1 command and 3469 casks (3,585 files, 3.9MB).
Error: Cask 'sts' is unavailable: No Cask with this name exists.
Any idea if i can install and manage STS using Homebrew, under a different caskname perhaps ?
You used a wrong package name. The package name for Spring Tool Suite in Homebrew is springtoolsuite.
brew cask install springtoolsuite
Use this latest :-
brew install --cask springtoolsuite

install gimp with homebrew?

I worked with gimp a while back when users had to install x11. I want to install it again for a project requiring image editing. I see there are a lot of enhancements to the installation process. It seems installing x11 is not required anymore. I am so used to brew everything. Is there a way to install gimp with homebrew?
Install Gimp
brew install gimp
This will install Gimp via Homebrew Cask automatically.
2020 edit: "brew cask install" is no longer necessary; brew will automatically tap casks when appropriate.
I tried to install using #pat's answer. It did not work.
The solution provided by #Gianfranco is the only one that did work:
brew tap caskroom/cask
brew install Caskroom/cask/gimp
The result is:
brew tap caskroom/cask
==> Tapping caskroom/cask
Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 3730, done.
remote: Compressing objects: 100% (3706/3706), done.
remote: Total 3730 (delta 39), reused 588 (delta 20), pack-reused 0
Receiving objects: 100% (3730/3730), 1.26 MiB | 1.39 MiB/s, done.
Resolving deltas: 100% (39/39), done.
Checking connectivity... done.
Tapped 0 formulae (3,738 files, 4.0MB)
And:
brew install Caskroom/cask/gimp
==> brew cask install Caskroom/cask/gimp
==> Downloading https://download.gimp.org/pub/gimp/v2.8/osx/gimp-2.8.22-x86_64.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask gimp
==> Installing Cask gimp
==> Moving App 'GIMP.app' to '/Applications/GIMP.app'.
🍺 gimp was successfully installed!

Homebrew is not working anymore

I used to have Homebrew installed, but then at some point it broke, so I tried reinstalling it.
I tried running:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It gave:
-e:70: warning: Insecure world writable dir /usr/local in PATH, mode 040777
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
(I don't know why it says it is installed, running brew gives "zsh: command not found: brew")
So I tried running that:
zsh: command not found: brew
Then I tried running it without brew clean-up. Which executed. I re-ran:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It starts downloading and installing until it gets to this point:
Downloading and installing Homebrew...
remote: Counting objects: 226839, done.
remote: Compressing objects: 100% (59610/59610), done.
remote: Total 226839 (delta 165997), reused 226815 (delta 165979)
Receiving objects: 100% (226839/226839), 52.14 MiB | 135.00 KiB/s, done.
Resolving deltas: 100% (165997/165997), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
warning: unable to access 'bin/.gitattributes': Permission denied
error: unable to create file bin/brew (Permission denied)
fatal: Could not reset index file to revision 'origin/master'.
Failed during: git reset --hard origin/master
Tried adding sudo:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Gives:
Don't run this as root!
I don't know where to go from here. Can someone help me?
Did you restart your terminal after installing zsh? brew is possibly not loaded for zshell. Also you need to add usr/local/ to your $path in .zshrc zsh configuration file should be in the in root ~/.zshrc

Can't re-install homebrew

I'm having a problem re-installing homebrew. I am running Mavericks
It started with me trying to install express.js. Homebrew had been installed on my mac for quite some time, never had any trouble with it. I used sudo npm install -g express, but when I ran express --version, I got command not found. Eventually, I found a possible solution online, and just tried to reinstall npm with brew remove npm and brew install npm. Again, I ran into errors (Unfortunately, I didn't save the exact errors) I used brew doctor to try and figure it out, looked up a ton of tutorials and mucked around with homebrew, and I guess I broke something.
Now, I figure I should just try and reinstall homebrew.
I run the install command for homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It returns this message:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
So, I run
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
This returns:
-bash: brew: command not found
I try running the install command again, and this time, it doesn't tell me homebrew is already installed.
So again, I run the install command for homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And now I get this:
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
remote: Counting objects: 136, done.
remote: Total 136 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (136/136), 10.37 MiB | 1.53 MiB/s, done.
Resolving deltas: 100% (44/44), done.
From https://github.com/Onomanatee/portfolio_Yuri_Legiest
* [new branch] master -> origin/master
HEAD is now at c253261 Commit4
==> Installation successful!
==> Next steps
Run brew doctor before you install anything
Run brew help to get started
Running brew doctor or brew help , however, results in
-bash: brew: command not found
I really don't know how to fix this. And why is the brew installer referring to a repository I used as a test for a little web project? (right above Installation succesful!)

Cannot install gems on RVM JRuby gemset: SocketError: initialize: name or service not known (http://rubygems.org/specs.4.8.gz)

I'm trying to install JRuby and Ruby on Rails (or "JRuby on Rails") with RVM on GNU/Linux Debian, but I'm getting some error. This is what I have done.
First of all, I made these installations (because of the requirements that are displayed with rvm requirements):
sudo apt-get install curl g++ openjdk-6-jre-headless
sudo apt-get install ant openjdk-6-jdk
Then (the error is at the end as you can see):
pablo#martigomez:~$ rvm install jruby --1.9
jruby-1.6.7.2 - #fetching
Cloning from git://github.com/jruby/jruby.git, this may take a while depending on your connection...
Initialized empty Git repository in /home/pablo/.rvm/repos/jruby/.git/
remote: Counting objects: 197772, done.
remote: Compressing objects: 100% (45785/45785), done.
remote: Total 197772 (delta 139597), reused 196103 (delta 138126)
Receiving objects: 100% (197772/197772), 108.15 MiB | 102 KiB/s, done.
Resolving deltas: 100% (139597/139597), done.
HEAD is now at 8e849de Tag ERB specs that depend on default runs sharing a scope.
From git://github.com/jruby/jruby
* branch master -> FETCH_HEAD
Already up-to-date.
Copying from repo to src path...
jruby-1.6.7.2 - #ant jar
jruby-1.6.7.2 - #ant jar -Djruby.default.ruby.version=1.9
Building Nailgun
jruby-1.6.7.2 - #installing to /home/pablo/.rvm/rubies/jruby-1.6.7.2
jruby-1.6.7.2 - adjusting #shebangs for (jrubyc jirb_swing jirb jgem rdoc ri spec autospec testrb ast generate_yaml_index.rb).
jruby-1.6.7.2 - #importing default gemsets (/home/pablo/.rvm/gemsets/)
Copying across included gems
pablo#martigomez:~$ rvm jruby
pablo#martigomez:~$ ruby -v
jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-09-24 26e08ba) (OpenJDK 64-Bit Server VM 1.6.0_18) [linux-amd64-java]
pablo#martigomez:~$ rvm --create use jruby#r328
Using /home/pablo/.rvm/gems/jruby-1.6.7.2 with gemset r328
pablo#martigomez:~$ gem list
*** LOCAL GEMS ***
pablo#martigomez:~$ gem install rails --version 3.2.8
WARNING: Error fetching data: SocketError: initialize: name or service not known (http://rubygems.org/specs.4.8.gz)
WARNING: Error fetching data: SocketError: Network is unreachable (http://rubygems.org/latest_specs.4.8.gz)
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: rdoc requires json (~> 1.4); treetop requires polyglot (>= 0), polyglot (>= 0.3.1)
I have searched but at the moment I haven't found something that helps. It is very strange that there are no gems. This is my first time with JRuby, but as I was searching on the web, when you install JRuby you suppose to have some basic gems installed, right? So what could it be the problem and the solution?
Thanks in advance!

Resources