Deploy meanjs into cloud9 IDE - configuration

I'm starting to develop with the stack meanjs. I'm using Cloud9 as a cloud IDE (I need its team functionalities). I tried previously to install mean in my local machine successfully. My problem arise when I try to install it in my cloud9 workspace. Does anybody know how to do it? I tried this https://github.com/meanjs/mean/issues/4 but it's not working.
Thank you so much in advance.

What you need to do is just following the steps that I listed in command line. I found the solution from youtube.
https://www.youtube.com/watch?v=RQ1HqBjT890
First, you need to utilize mongoDB. Type following:
echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
mkdir data
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$#"' > mongod
chmod a+x mongod
./mongod
At this point, your mongoDB server is running. Then, you need to install node package manager, update it. Also, install yo generator.
npm install npm -g
npm update
npm install -g yo
npm install -g generator-meanjs
Then, create your project directory, create your mean app.
mkdir myMeanProject
cd myMeanProject
yo meanjs
Open a new terminal window, and run server.
cd myNewProject
grunt

Related

Starting existing strapi project locally

How can I start existing strapi project locally?
I want to be able to run strapi dashboard locally.
I tried with npm install, npm run develop but I'm getting - npm ERR! missing script: develop.
Any help would be nice!
Tnx
Ok. So incase somebody else is still wondering how to solve this.
$ cd to your project
$ run the npm install or yarn to install the node_modules, and run the npm run develop or yarn develop.

"Check Pods Manifest.lock" fails Every time i download Project from github account

I am getting following error every time i download project from Github.I tried every other solution found on google but couldn't succeed.
diff: /Users//Documents//Pods/../Podfile.lock: No such file or directory
diff: /Users//Documents//Pods/Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Did you already create a podile?
With cocoapods installed, take the following steps:
Open a terminal window, and $ cd into your project directory (cd ~/Path/To/Folder/Containing/your/app)
Create a Podfile by running $ pod init
Open the podfile (open -a Xcode Podfile) and add the podline and save the file, for example:
pod 'AFNetworking', '~> 3.0'
Run $ pod install in your project directory
Open App.xcworkspace
Please find a more extended guide here
Hope this helps!

How to use ant to compile and deploy my webapp in openshift server?

I don't have ant in my server. When I do rhc ssh myapp and tried to use ant, it shows "bash: ant: command not found". But I find jars related to ant in my folder "jbossews/lib/catalina-ant.jar".
I tried to install ant by sudo apt-get install ant, but it shows "bash: /usr/bin/sudo: Permission denied"
so I dont know what to do.
Ant functionality is not available on OpenShift at this time. I'm working on clearing up some conflicting articles on our side. Also, root access (sudo) isn't available to users in their gears.
Just use the commands below:
wget https://www.apache.org/dist/ant/binaries/apache-ant-1.9.4-bin.zip
unzip apache-ant-1.9.4-bin.zip

Update composer.phar on Openshift

I have an application written in PHP using Fuelphp 1.6.3 and want to deploy it on Openshift
As the framework required composer, when I access my app at http://audit-manhthang.rhcloud.com/public/, it showed the error
Composer is not installed. Please run "php composer.phar update" in
the root to install Composer
I have Google it and found an article here: https://www.openshift.com/content/support-for-git-clone-on-the-server-aka-support-php-composerphar
I've tried to follow the instruction, create the file name deploy in .openshift/action_hooks folder and added following:
unset GIT_DIR
cd $OPENSHIFT_REPO_DIR/libs
wget -qN http://getcomposer.org/composer.phar
php composer.phar install
But it doesn't work. I have tried to revise install by update
unset GIT_DIR
cd $OPENSHIFT_REPO_DIR/libs
wget -qN http://getcomposer.org/composer.phar
php composer.phar update
But nothing change.
I use PHP 5.3 Cartridge on Openshift
When I did composer update
cd app-root/runtime/repo/php
/usr/bin/php composer.phar update
I received error like this
[RuntimeException]
/var/lib/openshift/52d3b7bd500446f4300001a5/.composer/cache/vcs does not exist and could not be created.
Composer is using $HOME variable to find root path. So to fix that I did.
export HOME=/var/lib/openshift/52d3b7bd500446f4300001a5/app-root/runtime/repo/php
and then
/usr/bin/php composer.phar update
worked.
After update was done I reverted $HOME
export HOME=/var/lib/openshift/52d3b7bd500446f4300001a5
Looks like there have been some changes how openshift works now. I know that this is quite ugly workaround. If I will find something better, I will update this answer. Still, hope this will help someone.
EDIT
Got it! :)
Create new file under .openshift directory:
.openshift/action_hooks/deploy
and mark it as executable.
#!/bin/bash
# Run composer install
cd app-root/runtime/repo/php
export HOME_ORIGIN=$HOME
export HOME=$HOME/app-root/runtime/repo/php
/usr/bin/php composer.phar install
export HOME=$HOME_ORIGIN
After that on every push composer will be updated to current composer.lock place. Perfect! :)
Also make sure vendor/ path is empty. Better add to .gitignore so it not messed up by your local setup.
Here is a slightly better solution than the others mentioned:
http://stanlemon.net/2013/03/22/composer-on-openshift/
The deploy script mentioned in the blog post:
a. downloads composer if not present and stores it in the data directory so that it persists
across git pushes
b. enables composer to use cached versions of packages in the .composer dir stored in the persistent data directory, thus decreasing the time required when doing frequent pushes
There was a small issue with the script - that the php version it was referring to was being complained as being too old by composer
remote: #!/usr/bin/env php
remote: Some settings on your machine may cause stability issues with Composer.
remote: If you encounter issues, try to change the following:
remote:
remote: Your PHP (5.3.3) is quite old, upgrading to PHP 5.3.4 or higher is recommended.
remote: Composer works with 5.3.2+ for most people, but there might be edge case issues.
So I changed the paths to use the latest present on the system
[domain.rhcloud.com action_hooks]\> php --version
PHP 5.4.16 (cli) (built: Dec 6 2013 01:17:01)
[domain.rhcloud.com 5316aa83e0b8cdb61b00023a]\> which php
/opt/rh/php54/root/usr/bin/php
The script in my .openshift/action_hooks/deploy is
#!/bin/bash
# Run composer install
cd app-root/runtime/repo/
export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer"
if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then
curl -s https://getcomposer.org/installer | /opt/rh/php54/root/usr/bin/php -- --install-dir=$OPENSHIFT_DATA_DIR
else
/opt/rh/php54/root/usr/bin/php $OPENSHIFT_DATA_DIR/composer.phar self-update
fi
( unset GIT_DIR ; cd $OPENSHIFT_REPO_DIR ; /opt/rh/php54/root/usr/bin/php $OPENSHIFT_DATA_DIR/composer.phar install )
As the blog post suggests - create an empty hot_deploy file in the markers subdirectory to further speed things up by saying that the servers should not be restarted during a push -
touch .openshift/markers/hot_deploy
git add .openshift/markers/hot_deploy
git add .openshift/action_hooks/deploy
git commit -m "Speeding up composer installs across pushes"
git push origin master
And watch your git pushes be fast even when using composer.
I figure it out. With openshift, I can access via SSH and go to app-root(or something like that)/repo/php and then type /usr/bin/php composer.phar update. That's it.
For reference, OpenShift comes with built-in support for Composer. Adding the use_composer marker file, simply an empty file named use_composer, in your OpenShift project's .openshift/markers directory will automatically enable Composer install/update on deployment.
More specifically, each time you git push to your OpenShift git repo...
When in 'production' mode (default):
echo -n "Checking composer.json for Composer dependency... "
if [ -f ${OPENSHIFT_REPO_DIR}composer.json ]; then
echo
composer install --no-interaction --no-ansi --no-scripts --optimize-autoloader --working-dir=${OPENSHIFT_REPO_DIR} || \
echo -e "\nSkipping Composer errors..\n\n Please, fix the errors either locally or in development mode.\n"
if [ ! -f ${OPENSHIFT_REPO_DIR}composer.lock ]; then
echo -e $composer_lock_msg
fi
else
echo "File not found."
fi
When in 'development' mode:
if [ -f ${OPENSHIFT_REPO_DIR}composer.lock ]; then
echo "Ignoring composer.lock file (development mode)"
fi
echo -n "Checking composer.json for Composer dependency... "
if [ -f ${OPENSHIFT_REPO_DIR}composer.json ]; then
echo
composer update --no-interaction --no-ansi --no-scripts --optimize-autoloader --working-dir=${OPENSHIFT_REPO_DIR}
echo -e $composer_lock_msg
else
echo "File not found."
fi
Check out the code beginning at line #142 of the OpenShift PHP Cartridge.
Check out the Developer Portal article on enabling PHP 'development' mode for more details.
Check out the Laravel 5 QuickStart for example-use or for an easy way to get started.
I do not have enough points to comment on wormhit's answer, so I will append it here:
The zend/php-*/etc/php.ini file needed an update for OpenShift to work with the latest version of composer.phar as described here:
extension=phar.so
extension=ctype.so
Adding these extensions to it fixes PHP's complaints about composer.phar
The next fix required using relative pathing:
php composer.phar install
INSTEAD of absolute pathing:
/usr/bin/php composer.phar install
to allow the extensions to load.

Installing behat with mink on windows using composer

I am trying to install mink/behat on windows machine using composer by following the help given on behat page. http://docs.behat.org/cookbook/behat_and_mink.html.
But when I run
php composer.phar install
then I get the error
But I have composer.json(exactly same as described in behat page) file in mentioned directory. Can someone please guide me how can I install it. Thanks
Composer installs packages on project-base. I don't think you have a PHP project inside C:\Windows\system32...
Navigate to your project by using cd (change dir) and be sure the composer.phar file is automatically loaded in every directory (see this answer).
Then create a composer.json file in which you put the things that is stated in the docs.
After that run composer install (or php composer.phar install, depends on which install method you used).