Ejabberd installation strange issue - erlang

OS: Debian 8.1 X64
trying to install eJabberd Community server based on this tutorial
At the end of installation, it pops error message
Error: Error running Post Install Script.
The installation may have not completed correctly
What am I doing wrong?

It looks like /bin/sh is Dash on your system (apparently the default since Debian Squeeze). However, the postinstall.sh script inside the package uses brace expansion, which while widely supported in various shells is not required by the POSIX standard, and thus Dash is not in error by not supporting it. The postinstall.sh script should either specify /bin/bash instead of /bin/sh in its first line, or abstain from using Bash-specific features.
You should be able to get a functioning ejabberd install by explicitly running the postinstall script with Bash:
sudo bash /opt/ejabberd-15.07/bin/postinstall.sh

Related

How do I run a script file in Windows?

I am trying to build Pyodide from source on Windows. In their documentation they recommend using Docker. From the documentation:
1 Install Docker
2 From a git checkout of Pyodide, run ./run_docker or ./run_docker --pre-built
3 Run make to build.
I don't understand how to run ./run_docker?
I don't even know exactly what the file is. Is it a shell script?
Combining your question, "How do I run a script file in Windows?", with the information provided (you want to run a file called run_docker from the Pyodide project) you should get started by installing the Windows Subsystem for Linux version 2 (WSL). After you install WSL, you will need to open a command prompt, run bash to enter the Ubuntu linux distribution. From here you should follow the steps for building on Linux. When you run into a problem you can search the internet for solutions related to "Linux" or "Ubuntu".

'$(' is not allowed as a global variable name

I wrote this line:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
at my command line and it's not working.
I have the message:
-e:1: '$(' is not allowed as a global variable name.
Here's the screen capture of the error:
That script is designed to install Homebrew, which is a Mac OS X package manager. According to your screenshot, you are running on Windows.
The reason of the error it's likely to be caused by the fact that the shell on Windows is different than the shell on Unix systems (specifically in this case Max OS X), therefore some commands may be different.
Apart from the error itself, whatever you are trying to do doesn't make sense at all. Homebrew is not designed to be installed on Windows.

Wkhtmltopdf in a Dokku app?

I have a NodeJS/Express Dokku container. I'm trying to use a node module which just runs the wkhtmltopdf command from shell, but it can't find wkhtmltopdf.
Anyone have any experience with this?
You need to check how wkhtmltopdf was installed in that image.
As mentioned in node-wkhtmltopdf issues 32:
The wkhtmltopdf command is executed as a shell command on non-Windows systems.
Make sure the /usr/local/bin directory is in your $PATH variable. Do this by running:
$ sh
sh-3.2$ which wkhtmltopdf # Or try:
sh-3.2$ echo $PATH
sh-3.2$ exit
(In your case, you can do a sudo docker exec -it <containerIdOrName> sh)
The same issue adds:
What I ended up doing was downloading the dmg directly from wkhtmltopdf and that seemed to do the trick.
That means you might have to create a new image from the current one, installing wkhtmltopdf that way (with the dmg package)
jsonfry what installing wkhtmltopdf as a service container means: openlabs/docker-wkhtmltopdf-aas illustrates the installation process.
I got into the same issue as you did. I didn't want to run wkhtmltopdf in another container nor did I want to change the code to use remote calls. Since downloading wkhtmltopdf using apt-get plugin may result in a package that throws errors, I have created a new plugin that should set up wkhtmltopdf in the dokku container for you.
It is licensed using MIT license so feel free to do whatever you want. Hopefully it will help somebody.
URL: https://github.com/mbriskar/dokku-wkhtmltopdf

Installing Ruby on Rails on Windows via CYGWIN

I am attempting to follow instructions on this page:
http://www.agilereasoning.com/2011/05/25/ruby-on-rails-on-windows-7-using-cygwin/
I have been trying to install Rails with varying success first using the railsinstaller and I encounter difficulties like no vim and I couldn't copy and paste from the Windows command prompt so I install CYGWIN. It didn't download the files correctly so I downloaded them manually and some were hard to locate. I couldn't find the final package as a .tar file so I downloaded libxslt-devel-1.1.20-1.i386.rpm.
Right click the Cygwin shortcut and choose edit from the menu. Change the contents to >match:
1 #echo off
2 C:\cygwin\bin\rxvt -sr -sl 1500 -e C:\cygwin\bin\bash.exe --login -i
Do I have to put this as a command to run on the executable or inside the cygwin commmand prompt? When I try to do that I get this:
-bash: 'command': command not found
Lots of things wrong here.
You can copy/paste the command prompt with Edit->Mark or Edit->Paste
libxslt-devel-1.1.20-1.i386.rpm is a linux file.
C:\cygwin\bin\rxvt - why are you mesing around with rxvt?
I recommend you install the rubyinstaller + devkit and then do gem install rails. However don't expect to be happy with rails' performance on windows.
Ruby on Rails on Windows via CYGWINTry:
Install Vagrant
Virtual Box,
and Cygwin (or PuTTy, I am using Cygwin).
With this set, open Cygwin, go to your project folder, run vagrant init <box> (my box is hashicorp/precise64 - see others)
(you may also want to cfg your Vagrantfile?). All set, Run: vagrant up and vagrant ssh
Now you have a virtual machine (Ubuntu) running, and you can install rvm (recommended... so you can have different versions of Ruby), or go directly with ruby, rails, etc.. (sudo apt-get ruby -v x.x.x,etc)
- Vagrant "creates and configures lightweight, reproducible, and portable development environments".
- Cygwin helps with ssh issues, etc...
- Virtual Box manages the machine (Ubuntu, or other OS)
With this set, I have no problem at all running Ruby (on Rails) with Windows.

Rails: Why "sudo" command is not recognized?

In my application directory (on Windows) I run:
sudo pdfkit --install-wkhtmltopdf
as explained here, but I got this error:
'sudo' is not recognized as an internal or external command,
operable program or batch file.
What could be the problem ?
Sudo is a Unix specific command designed to allow a user to carry out administrative tasks with the appropriate permissions.
Windows does not have (need?) this.
Run the command with the sudo removed from the start.
sudo is a Unix/Linux command. It's not available in Windows.
sudo is used for Linux. It looks like you are running this in Windows.
That you are running Windows. Read:
http://en.wikipedia.org/wiki/Sudo
It basically allows you to execute an application with elevated privileges. If you want to achieve a similar effect under Windows, open an administrative prompt and execute your command from there. Under Vista, this is easily done by opening the shortcut while holding Ctrl+Shift at the same time.
That being said, it might very well be possible that your account already has sufficient privileges, depending on how your OS is setup, and the Windows version used.
sudo is a command for Linux so it cant be used in windows so you will get that error
Sudo is a Unix specific command designed to allow a user to carry out administrative tasks with the appropriate permissions.
Windows doesn't not have (need?) this.
Yes, windows don't have sudo on its terminal. Try using pip instead.
Install pip using the steps here.
type pip install [package name] on the terminal. In this case, it may be pdfkit or wkhtmltopdf.
Analogue to sudo in Windows is running command prompt "As Administrator" by right-clicking on it's link. Then everything you run in it will be "sudo-ed".
sudo is not for windows, its for unix/linux.
option 1: install ubuntu cli software (not OS) in windows, here is the windows store link: https://www.microsoft.com/en-in/p/ubuntu-2004/9n6svws3rx71. After installing you can use ubuntu's cli in your windows where sudo will work.
option 2: install and use gem (ruby on rails) for installing wkhtmltopdf-binary
gem install pdfkit
gem install wkhtmltopdf-binary
ref: https://github.com/pdfkit/pdfkit
option 3: you can use npm or python for wkhtmltopdf insted of ruby on rails, both modules (nodeJS python) works fluently and compatible with windows:-
https://www.npmjs.com/package/wkhtmltopdf
https://pypi.org/project/wkhtmltopdf/

Resources