'$(' is not allowed as a global variable name - ruby-on-rails

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.

Related

Unison command not found

Recently my Unison application has stopped working on my Mac terminal saying the command cannot be found. Not sure if this was the reason but I recently reinstalled brew (which is how it was installed), which may have broken it.
Here is the error output:
mac:~ Imran$ unison sites
-bash: unison: command not found
I can see that if I locate unison unison is found in the following directories:
> /Users/Imran/unison.log /Users/Imran/unison.tar.gz
> /usr/local/Cellar/unison /usr/local/Cellar/unison/2.40.102
> /usr/local/Cellar/unison/2.40.102/COPYING
> /usr/local/Cellar/unison/2.40.102/INSTALL_RECEIPT.json
> /usr/local/Cellar/unison/2.40.102/NEWS
> /usr/local/Cellar/unison/2.40.102/README
> /usr/local/Cellar/unison/2.40.102/TODO.txt
> /usr/local/Cellar/unison/2.40.102/bin
> /usr/local/Cellar/unison/2.40.102/bin/unison
> /usr/local/Library/Formula/unison.rb
> /usr/local/Library/LinkedKegs/unison /usr/local/bin/unison
> /usr/local/opt/unison /usr/share/zsh/5.3/functions/_unison
Can someone help me get this working again? I suspect its something to do with the link to the app being broken.
If you've done a reinstall of a brew cask, you may need to manually link it again if it can't be found on your path
brew link unison
I had the same issue when trying to use Unison from Windows to Mac (where it has been installed with Brew).
You can give an explicit path for the unison executable on the server by using the command-line option
-servercmd /full/path/name/of/unison
or adding
servercmd=/full/path/name/of/unison
to your profile
Source
According to the documentation the error message bash: unison: command not found means:
Make sure Unison is installed on the host you are trying to connect to.
For anyone running into this error on macOS:
If you're using zsh (or running a newer macOS version where zsh is the default) you have to modify or create ~/.zshenv.
Add your path to the shell environment by adding one of the following snippets to ~/.zshenv.
For ARM64 (M1 Macs):
eval $(/opt/homebrew/bin/brew shellenv)
or on x86 (Intel Macs)
eval $(/usr/local/bin/brew shellenv)
or you simply source your zshrc:
source ~/.zshrc
Your user's PATH variable does not include a link to the unison binary.
Add /usr/local/Cellar/unison/2.40.102/bin/unison to your .bashrc,
$ vi ~/.bashrc
add the following,
export PATH=$PATH:/usr/local/Cellar/unison/2.40.102/bin/unison
save and quit, and then re-read your users bashrc file,
exec bash
Now try which unison again, or actually just try running it with,
$ unison

Ejabberd installation strange issue

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

ImageMagick, "which" is not recognized as an internal or external command

I just installed ImageMagick on my windows machine so I can use it with the paperclip gem with RUby on Rails. When I try to run "which convert" into the command prompt, it returns a 'which' is not recognized as an internal or external command,
operable program or batch file.
I am relatively new to command prompt and still trying to learn as much as I can. What is wrong with my command and how do I fix it?
The command is right. The OS is wrong.
which is a unix command not a windows one.
See the equivalent Windows command
Just use the following command on Windows:
where package_name

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