Failing to download Leiningen standalone jar file - clojure

I am simply unable to install leiningen on Debian linux :
> lein
Downloading Leiningen to /home/debianaut/.lein/self-installs/leiningen-2.4.3-standalone.jar now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 355 100 355 0 0 240 0 0:00:01 0:00:01 --:--:-- 375
100 14.2M 100 14.2M 0 0 51565 0 0:04:48 0:04:48 --:--:-- 41059
Failed to download https://github.com/technomancy/leiningen/releases/download/2.4.3/leiningen-2.4.3-standalone.jar
It's possible your HTTP client's certificate store does not have the
correct certificate authority needed. This is often caused by an
out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT
to turn off certificate checks:
export HTTP_CLIENT="wget --no-check-certificate -O" # or
export HTTP_CLIENT="curl --insecure -f -L -o"
It's also possible that you're behind a firewall haven't yet
set HTTP_PROXY and HTTPS_PROXY.
I tried with setting HTTP_CLIENT but still same error . The version I read from lein script is 2.4.3.

I also experienced this error. This is what I did in Ubuntu 15.04, with Leiningen 2.5.2.
Save the lein file into the ~bin directory (create it if it doesn't exist).
Change the permissions of the lein file to make it executable (chmod 755 ~/bin/lein)
Open lein with a text editor
On line 116, change .jar to .zip, so that it should be LEIN_JAR="$LEIN_HOME/self-installs/leiningen-$LEIN_VERSION-standalone.zip"
Download Leiningen 2.5.2 from GitHub.
Put the zip file leiningen-2.5.2-standalone.zip into ~/.lein/self-installs (do not unzip - create the directory if it doesn't exist - this is a hidden directory, in Gnome Files, hit Ctrl+H to see it)
To initiate your first project: lein new MyFirstLeinProject
VoilĂ .

I had the same problem using leiningen 2.1.3 on Mac OS X 10.8.5 (Mountain Lion). That script tried to download https://leiningen.s3.amazonaws.com/downloads/leiningen-2.1.3-standalone.jar
Eventually I went back to leiningen.org and fetched the current lein script from https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
It worked well. The resource downloaded was: https://github.com/technomancy/leiningen/releases/download/2.5.1/leiningen-2.5.1-standalone.zip

Related

Go command not found while running code deploy hook

Hello I'm trying to create a CodeDeploy deployment for my golang application. I have an autoscaling group that uses a AMI I created that has all the libs I need installed. When I try to run CodeDeploy it exists with an error in my after_install:
LifecycleEvent - AfterInstall
Script - scripts/after_install.sh
[stderr]/opt/codedeploy-agent/deployment-root/a65d9a2e-fddd-471c-8ea1-c018792d00bd/d-4IKP3PP4Y/deployment-archive/scripts/after_install.sh:
line 4: go: command not found
I know go is installed on the server I can verify by sshing into the server and running the go command. Initially I had my after_install hook run as root so that's why I thought it complained about go not being installed.
I updated it to run as ubuntu here is the appspec file
version: 0.0
os: linux
files:
- source: ./
destination: ./home/ubuntu/code
hooks:
AfterInstall:
- location: scripts/after_install.sh
timeout: 180
runas: ubuntu
ApplicationStart:
- location: scripts/application_start.sh
timeout: 180
runas: root
But I still get the error of go command not found. I SSH into the server as ubuntu user and I can clearly see go is installed.
I took it one step further and ran the after_install.sh file and it worked with no errors. What am I doing wrong here?
Just for the extra curious here is my after_install.sh file
#!/bin/bash
cd /home/ubuntu/code/vibeify/cmd/vibeify
go build
If you can use go command without the full installation path only in the interactive shell, check $HOME/.bashrc.
It may depends on OS default settings, but some OS default bashrc file includes scripts that does not load profile in non-interactive shell.
# open $HOME/.bashrc file
# and comment out these lines
case $- in
*i*) ;;
*) return;;
esac

Apache Zeppelin 0.7.3 - http error 503 in browser

Following the minimalist installation instructions from here, then on macOS High Sierra 10.13.1 executing:
bin/zeppelin-daemon.sh start
The daemon starts OK, but pointing any browser to http://localhost:8080 yields
HTTP ERROR: 503
Problem accessing /. Reason:
Service Unavailable
Powered by Jetty://
The same thing happens if I run as root, or if I run the browser as root, or if I install via homebrew (brew install apache-zeppelin).
Permissions problem?
What is a solution?
Thanks!
The workaround was:
Install Java 8, following How to set or change the default Java (JDK) version on OS X?, i.e.
brew tap caskroom/versions
brew cask install java8
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Then:
sudo bash
zeppelin-daemon.sh start
/Applications/Safari.app/Contents/MacOS/Safari
Point browser to:
http://localhost:8080
Success! Conclusions:
Zeppelin 0.7.3 only supports Java <= 8.0
zeppelin-daemon.sh must be run as root, but browser doesn't have to be
Install Java 1.8 as mentioned in the above post.
If we can give the super user password at the time of installing, we do not have to run as root every time. See below for the logs and the option to give password.
[ksurendranath#machine /usr/local/Cellar/apache-zeppelin/0.7.3/libexec/logs 10:54 AM ]$ brew cask install java8
==> Tapping caskroom/cask
Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 4057, done.
remote: Compressing objects: 100% (4022/4022), done.
remote: Total 4057 (delta 37), reused 824 (delta 31), pack-reused 0
Receiving objects: 100% (4057/4057), 1.39 MiB | 11.49 MiB/s, done.
Resolving deltas: 100% (37/37), done.
Tapped 0 formulae (4,066 files, 4.4MB)
==> Creating Caskroom at /usr/local/Caskroom
==> We'll set permissions properly so we won't need sudo in the future
Password:
Get the process info on the port you are using the Zeppelin server
1)sudo netstat -anp|grep 8080
2)sudo kill (ProcessID)
3)/zeppelin-server/bin/zeppelin-daemon.sh restart
This might help you

Shiny deployment error

When I am trying to deploy my shiny app at shinyapps.io I get below error :
> deployApp()
Preparing to deploy application...DONE
Uploading bundle for application: 187055...DONE
Deploying bundle: 857060 for application: 187055 ...
Waiting for task: 416072120
building: Processing bundle: 857060
building: Parsing manifest
building: Building image: 849457
building: Installing system dependencies
################################ Begin Task Log ################################
[2017-06-07T17:28:40.200495546+0000] Execute script: packages/build/nloptr.sh
+ set -e
+ VERSION=2.4.2
+ cd /tmp
+ curl -O http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0################################# End Task Log #################################
Error: Unhandled Exception: Child Task 416072122 failed: Error building image: Build exited with non-zero status: 56
Has anyone come across this error. Appreciate if someone help me on how to resolve this. I am using R version 3.4.0
Thanks,
It looks like your app require NLopt, but shinyapps.io failed to install the package. The package installation seemed to be some shell script which may not work in the shinyapps.io server(because of permission etc).
Basically the deployment process scan your file and environment, then try to duplicate the dependency packages in the server. If you used CRAN version the server will also install CRAN version, which should not need build from source or running some shell script. If you used github version server will also try to use github version or build from source, which could have more dependency requirement.
Another possibility is the R package is just the interface and you need to install the actual library, which failed to be installed in server.
R packages will often rely on operating system packages to be
installed on the server. If your application happens to use an R
package that requires a system library that is not installed by
default, please let us know by filing an issue, or a pull request, at
shinyapps-package-dependencies

How to install Google Cloud SDK on Travis?

I have tried to install Google Cloud SDK on Travis with the following .travis.yml
sudo: required
language: go
- curl https://sdk.cloud.google.com | bash;
My attempt is inspired by this guide from Google: https://cloud.google.com/solutions/continuous-delivery-with-travis-ci
Unfortunately, I get this output on Travis:
$ curl https://sdk.cloud.google.com | bash;
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 421 0 421 0 0 17820 0 --:--:-- --:--:-- --:--:-- 60142
Downloading Google Cloud SDK install script: https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash
######################################################################## 100.0%
Running install script from: /tmp/tmp.uz8jP70e56/install_google_cloud_sdk.bash
which curl
curl -# -f https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
######################################################################## 100.0%
Installation directory (this will create a google-cloud-sdk subdirectory) (/home/travis):
Travis waits for 10 minutes and then terminates the build. It seems like it is waiting for an installation directory.
How do I install Google Cloud SDK on Travis?
You are running into this issue because there is no interaction possible on Travis CI. Hence, the installation script is blocked waiting for input and Travis CI kills the build after 10 minutes.
The trick is to disable the prompts when installing the Google Cloud SDK. This can be done by setting the CLOUDSDK_CORE_DISABLE_PROMPTS environment variable to 1.
Here's a sample recipe to put in your .travis.yml file (including caching it for faster subsequent builds):
cache:
directories:
- "$HOME/google-cloud-sdk/"
script:
- gcloud version || true
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
# Add gcloud to $PATH
- source /home/travis/google-cloud-sdk/path.bash.inc
- gcloud version
Hope this helps!

How to run clojure on OpenShift

I am trying to deploy a Clojure application on OpenShift using the clojure-cartridge running the following command:
rhc app create myapp http://cartreflect-claytondev.rhcloud.com/github/openshift-cartridges/clojure-cartridge
I can run the application locally using lein run and looking at http://localhost:8080/ It works as expected. But when I run it from OpenShift I get: Service Temporarily Unavailable.
When I do rhc tail I get:
Downloading Leiningen to /var/lib/openshift/54a1a338fcf933fb93000106/clojure//home/self-installs/leiningen-2.5.0-standalone.jar now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14.2M 100 14.2M 0 0 18.6M 0 --:--:-- --:--:-- --:--:-- 25.5M
Could not transfer artifact lein-ring:lein-ring:pom:0.7.5 from/to clojars (https://clojars.org/repo/): Specified destination directory cannot be created: /.m2/repository/lein-ring/lein-ring/0.7.5
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
I am new to both Clojure and using OpenShift, so I could have missed or misunderstood something obvious. But any ideas on what is going wrong?
I don't know anything about OpenShift though this error:
Specified destination directory cannot be created: /.m2/repository/lein-ring/lein-ring/0.7.5
is a strong hint that the $HOME environment variable is not available in OpenShift. lein writes files to $HOME/.m2/repository/... so if $HOME where unset it would result in the error above. It looks like OpenShift allows this:
Setting Custom Environment Variables
Set one of more environment variables for an application with the following command:
$ hc env set <Variable>=<Value> <Variable2>=<Value2> -a App_Name