Closed Krasnyanskiy closed 9 years ago
Something like this would work. You could either permit Homebrew to create a new Jar script for you, or simply replace bin.write_jar_script
with bin.install_symlink libexec/"run.sh"
. Should work. Let us know if you hit any further issues.
I got this error
$ brew install jrsh
Error: undefined method `desc' for Formulary::Formulae::Jrsh:Class
Please report this bug:
https://git.io/brew-troubleshooting
/usr/local/Library/Formula/jrsh.rb:2:in `<class:Jrsh>'
/usr/local/Library/Formula/jrsh.rb:1:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:92:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:92:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:82:in `klass'
/usr/local/Library/Homebrew/formulary.rb:71:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:200:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `block in formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `formulae'
/usr/local/Library/Homebrew/cmd/install.rb:41:in `install'
/usr/local/Library/brew.rb:140:in `<main>'
Here is my jrsh.rb file
class Jrsh < Formula
desc "A Command Line Interface for JasperReports Server"
homepage "https://github.com/Krasnyanskiy/jrsh/"
url "https://github.com/Krasnyanskiy/jrsh/releases/download/v2.0.4/jrsh-2.0.4-jar-with-dependencies.jar"
def install
libexec.install "bfg-1.12.3.jar"
bin.install_symlink libexec/"jrsh.sh"
end
test do
system "#{bin}/jrsh"
end
end
Make sure your brew is up-to-date with brew update
.
After update I got this error
$ brew install jrsh
==> Downloading https://github.com/Krasnyanskiy/jrsh/releases/download/v2.0.4/jrsh-2.0.4-jar-with-dependencies.jar
==> Downloading from https://s3.amazonaws.com/github-cloud/releases/27540930/a49364a4-29d6-11e5-82a2-44fa98af1423.jar?re
######################################################################## 100.0%
Warning: Cannot verify integrity of jrsh-2.0.4.jar
A checksum was not provided for this resource
For your reference the SHA256 is: 5b3417c6658281ee6db60c8c70aace2d827eeefcffdf4ad822fee4c1fad69596
Error: No such file or directory - bfg-1.12.3.jar
I fixed libexec.install
and installed jrsh
one more time.
==> Downloading https://github.com/Krasnyanskiy/jrsh/releases/download/v2.0.4/jrsh-2.0.4-jar-with-dependencies.jar
Already downloaded: /Library/Caches/Homebrew/jrsh-2.0.4.jar
Warning: Cannot verify integrity of jrsh-2.0.4.jar
A checksum was not provided for this resource
For your reference the SHA256 is: 5b3417c6658281ee6db60c8c70aace2d827eeefcffdf4ad822fee4c1fad69596
🍺 /usr/local/Cellar/jrsh/2.0.4: 2 files, 13M, built in 2 secondsv
But I still can not run the app
$ jrsh
-bash: jrsh: command not found
Hmmm... I made
brew create 'https://github.com/Krasnyanskiy/jrsh/releases/download/v2.0.4/jrsh-2.0.4.zip'
brew audit --strict jrsh
brew update
brew reinstall jrsh
And now it works fine.
Resolved.
Error: No available formula for jrsh Searching formulae... Searching taps...
Did you create the new formula in a branch and then brew update
? You may need to check the branch out again if so.
Oh, how can I do it?
Any idea if you created the new formula in a branch or not?
Yes, I guess I changed it.
So, I need to make brew install ...
again, right?
Unless you've uninstalled it, the installation should still be there.
I've cleaned up all brew stuff and tried to reinstall the app. Here is what I got
$ brew install 'https://github.com/Krasnyanskiy/jrsh/releases/download/v2.0.4/jrsh-2.0.4.zip'
######################################################################## 100.0%
Error: uninitialized constant Formulary::FormulaNamespace3d9081e5aaefaee72d78da84dd674461::PK
Please report this bug:
https://git.io/brew-troubleshooting
/Library/Caches/Homebrew/Formula/jrsh-2.0.4.zip:1:in `load_formula'
/usr/local/Library/Homebrew/formulary.rb:21:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:21:in `load_formula'
/usr/local/Library/Homebrew/formulary.rb:78:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:128:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:69:in `klass'
/usr/local/Library/Homebrew/formulary.rb:65:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:170:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `block in formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `formulae'
/usr/local/Library/Homebrew/cmd/install.rb:41:in `install'
/usr/local/Library/brew.rb:124:in `<main>'
Seems I uninstalled it
$ brew uninstall jrsh
Error: No such keg: /usr/local/Cellar/jrsh
You'll need to re-install it from the formula you created.
How can I do it? Could you tell me please what command should I use?
And I've noticed that I can't find the formula: http://brewformulas.org/search?utf8=%E2%9C%93&search%5Bterm%5D=jrsh&commit=Search
brewformulas will only list official formulae, not user-generated ones that haven't been merged into the core.
You'll need to check out whichever branch you created the formula in, and then brew install jrsh
again. You can see which branches exist by doing cd $(brew --prefix) && git branch
.
Ok, now it works. But other people could not install it. I made pull request with my formula jrsh.rb
.
Thanks. Will let the test-bot review the submission, Closing here.
Ok, thanks.
I have two files: executable jar file
jrsh-2.0.4.jar
andjrsh.sh
script to run the jar. I want to run it through the Homebrew. What should I do to make it possible?My
run.sh
scriptI created a tar.gz file and made a formula
Then I downloaded it using
brew install jrsh
. But it doesn't work.