How to install nvm for the www-data user in Ubuntu? - nvm

I already have installed nvm for a different user, but I now want it also installed for www-data.
So I try the following:
su -s /bin/bash www-data
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
But I'm getting the following warning and nothing happens:
nvm is already installed in /home/user1/.nvm, trying to update using git
What can I do?

Related

Git init -q Permissions error while installing Homebrew

I'm attempting to install HomeBrew on OS X 10.12.6. When I use the autoinstall script from Homebrew's website:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Everything runs smoothly until it begins actually downloading and installing Homebrew, at which point it returns the following error:
==> Downloading and installing Homebrew...
/usr/local/homebrew/.git: Permission denied
Failed during: git init -q
Any tips of how to resolve this? Any assistance would be greatly appreciated!
You should make your /usr/local/bin and /usr/local/opt writeable, i.e.:
chmod +w /usr/local/bin
chmod +w /usr/local/opt
Depending on your user's permissions you may have to use sudo to achieve it.
Maybe git is missing:
apt install git

Correct install for RVM and Chef

I installed rvm for multi-user on my server.
\curl -sSL https://get.rvm.io | sudo bash -s stable
sudo usermod -a -G
rvm ubuntu rvm install 2.1.1
rvm --default use 2.1.1
I also installed Chef
curl -L https://www.opscode.com/chef/install.sh | sudo bash
But when i run "gem install chef" under ubuntu i get
You don't have write permissions into the /opt/chef/embedded/lib/ruby/gems/1.9.1 directory
Obviously i can just change the permissions but I'm assuming this isn't how i should set this up.
Any help would be greatly appreciated.
The omnibus installer, aka:
curl -L https://www.opscode.com/chef/install.sh | sudo bash
Installs Chef for you. You don't need to install Chef. You can run chef as chef-client or chef-solo.
Chef get's installed into /opt/chef and it packages it's own Ruby, etc.
With respect to your RVM issues:
Have you added the required lines to your .bashrc?
Are you actually executing a login shell (-l)?
Why are you trying to install chef into rvm?

Compiling libapache2-svn for Apache 2.4.4

I want to use Apache 2.4.4 with SVN on Ubuntu server 12.04 (Precise Pangolin). But when I use
apt-get install libapache2-svn
I get the following dependencies error
The following packages have unmet dependencies:
libapache2-svn : Depends: apache2.2-common but it is not going to be installed
Googling around I got some suggestion about compiling from source by hand. I don't know how to do that. How can I do it?
I have two solutions:
Follow the instructions in this Server Fault Q&A.
*Note: Create another user if you're using a root account on the server.
I've asked Ondřej Surý on Launchpad to add Subversion to his Apache PPA. You can add Ondřej Surý's PPA to perform a normal update/upgrade.
You did ask Ondrej to include Subversion in his PPA launchpad. But I couldn't install the libapache2-svn package after adding Ondrej's PPA.
Somehow the instructions provided for compiling didn't work for me so here's an alternative way to get it working.
Reference:
(https://askubuntu.com/questions/312568/where-can-i-find-a-subversion-1-8-binary)
WANDisco has Subversion 1.8 for Ubuntu then:
sudo sh -c 'echo "# WANdisco Open Source Repo" >> /etc/apt/sources.list.d/WANdisco.list'
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu precise svn18" >> /etc/apt/sources.list.d/WANdisco.list'
wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
After that:
apt-cache show subversion | grep '^Version:'
And then you should be good to install normally:
sudo apt-get install subversion libapache2-svn

PHP Fatal error: Class 'Phalcon\Script\Color' not found

I'm running Ubuntu Server 12.10 and have installed phalcon like this
sudo apt-get install php5-dev php5-mysql gcc git-core
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
then I've added
extension=/usr/lib/php5/20100525/phalcon.so
to php.ini which located in /etc/php5/apache2/php.ini and restarted apache2. If I execute
<?php print_r(get_loaded_extensions()); ?>
I can see that the phalcon extension is loaded. Then I've installed phalcon-devtools like that
git clone git://github.com/phalcon/phalcon-devtools.git
cd phalcon-devtools
sudo ./phalcon.sh
and restarted apache2. No errors were shown during that operations, but when I'm trying to execute
phalcon commands
I get an error like this
PHP Fatal error: Class 'Phalcon\Script\Color' not found in /home/user/phalcon-devtools/phalcon.php on line 84
What I'm doing wrong?
So the problem was in php.ini for CLI, which is located in /etc/php5/cli/, after I added extension=/usr/lib/php5/20100525/phalcon.so there, I was able to use Devtools. Thanks to #NikolaosDimopoulos
Official documentation is a bit confusing so try this:
I think this is a problem of extension not loaded
After successfully compile steps:
sudo apt-get install php5-dev php5-mysql gcc git-core
git clone git https://github.com/Phalcon/cphalcon.git
cphalcon cd/build
sudo ./install
Create a new file called "30-phalcon.ini"
and within it call the extension Phalcon with this single line:
extension=phalcon.so
save the file and copy the folder "/etc/php5/apache2/conf.d /" and "/etc/php5/cli/conf.d/"
restart the server: sudo service apache2 restart
While the devtools do this:
sudo git clone https://github.com/phalcon/phalcon-devtools /var/www/devtools
then create a symbolic link to run via terminal:
1: sudo ln -s /var/www/devtools/phalcon.php /usr/bin/phalcon
2: sudo chmod ugo+x /usr/bin/phalcon
3: type "phalcon" in the terminal and see if it's work.
it should work now: D
I always install the devtools from the PEAR channel
pear channel-discover pear.phalconphp.com
pear install phalcon/Devtools
You might get an error that the Devtools are not in stable mode but (as of the time of this writing) you can use this command:
pear install phalcon/Devtools-0.5.0
Source

RVM Installation

I am trying to install rvm on ubuntu 11.10.
I have installed it using following command through curl.
curl -L get.rvm.io | bash -s stable --auto-dotfiles
On terminal it specifies that rvm has been installed properly and I have checked .rvm directory has been created properly in my home directory and in .rvm directory version file is present but when I write rvm -v on terminal it gives following msg
~$ rvm -v
The program 'rvm' is currently not installed. You can install it by typing: sudo apt-get install ruby-rvm
Please help.
Did you add the PATH to your .bashrc file?
[[ -s "$HOME/.rvm/src/rvm/scripts/rvm" ]] && . "$HOME/.rvm/src/rvm/scripts/rvm"
After you added it, reload it:
source ~/.bashrc
EDIT: this is not recommended way of RVM, rvm does shell file initialization, if you need force this process run rvm get head --auto-dotfiles