Picture of Mathew Gancarz
Working with Adapt Framework on headless command line accessed web server or windows?
by Mathew Gancarz - Tuesday, 28 January 2014, 7:53 PM
 

Hi everyone, with the release of the 1.0 I've given a shot at trying to setup the development environment and ran into some hurdles. This is a long post so I've split it into two.

In our environment we use windows desktops primarily and our servers are linux headless servers that we simply ssh into. Going through the instructions in the github wiki: 

https://github.com/adaptlearning/adapt_framework/wiki/Setting-up-your-development-environment

I've tried to set it up both on my local Windows 7 64-bit machine and on our web server via ssh.

On the server, all the steps complete, including the grunt build. I am able to take the output from the build directory and throw it up on a website and zip it up as a scorm and publish it to our Moodle and all looks to work as expected.

The problem is the 'Viewing the build' step. When I try to run grunt server, I get the following output:

Running "concurrent:server" (concurrent) task
>> Warning: There are more tasks than your concurrency limit. After this limit
>> is reached no further tasks will be run until the current tasks are
>> completed. You can adjust the limit in the concurrent task options
Warning: Running "open:server" (open) task
Warning: Command failed: /home/mgancarz/adapt/framework/node_modules/grunt-open/node_modules/open/vendor/xdg-open: line 584: xdg-mime: command not found
xdg-open: no method available for opening 'http://localhost:9001/'
Use --force to continue.

Aborted due to warnings. Use --force to continue.

Aborted due to warnings.

Same with the grunt server-scorm command. I assume this is because this server doesn't actually have a desktop environment setup and thus can't open a browser and display the content.

It looks like though I technically don't need to run a local server on the machine through grunt, since this machine already runs Apache?

I could just set up some script that copies the finished grunt build to the web directories and refresh my browser. Am I missing anything by excluding the grunt server steps?

 

Picture of Mathew Gancarz
Re: Working with Adapt Framework on headless command line accessed web server or windows?
by Mathew Gancarz - Tuesday, 28 January 2014, 9:36 PM
 

Second part, regarding setting up the dev environment on windows. I've made my own notes for getting Node.JS setup on windows, but run into issues at the core bundle install part and with the way our user profiles are setup. Working with Node in general in Windows is a little bit of a pain right now.

Issues I've run into so far:

  • The node.js installer doesn't amend the PATH variables properly, I've had to manually do that.
  • Our user profiles are redirected to a network share and %appdata% resolves to a long UNC path, which seems to break things. You will want to run this as a user that has a local %appdata% folder.
  • If the command line paths don't include git properly also, you may need to run the core bundle installer 'adapt install' from the Git Bash command line.

I can share these notes with the community if someone is interested, but it's a bit of a mess right now due to the way things work in our domain environment.

Ideally what I'd like to see is a xampp style portable environment. All you need to do is download it, unzip it onto your C drive and run the commands within.

Picture of Amir Elion
Re: Working with Adapt Framework on headless command line accessed web server or windows?
by Amir Elion - Tuesday, 28 January 2014, 11:26 PM
 

Hi Mathew

We've run into similar problems installing on windiws.

Would appreciate any notes or help you can suggest.

Thsnks

Amir

Picture of Mathew Gancarz
Re: Working with Adapt Framework on headless command line accessed web server or windows?
by Mathew Gancarz - Tuesday, 28 January 2014, 11:59 PM
 

Hi Amir, so far I've gotten it working by doing the following:

1) Do everything using a local account, using admin access. IE: Run the command prompt as an administrator that has a local %appdata% directory.

2) Make sure Git is in the system path. The directions here are good: http://blog.countableset.ch/2012/06/07/adding-git-to-windows-7-path/

3) Make sure nodejs is in the system path also, It will be either C:\Program Files\nodejs\ or Program Files (x86) if you installed the x86 version.

Once you do that it should work just as described in the setting up your dev environment wiki page.

I think it should be possible to do it using a local non-admin account also, but you'll need an admin to edit the system paths and install Node.js and Git anyways.

I'd also recommend running grunt server-scorm to avoid the annoying missing LMS error messages. 

Picture of Chris Jones
Re: Working with Adapt Framework on headless command line accessed web server or windows?
by Chris Jones - Wednesday, 29 January 2014, 9:37 AM
 

Hello Matthew & Amir,

Thanks for the feedback!

We've tried to get the whole development environment working cross-platform as best we can, but information like this is really valuable and will no doubt help many other who experience similar problems.

I'd like to add as general points:- 

  • When installing from the command, ensure you have sufficient privileges; on Windows you may need to "Run as Administrator", Mac and Linux user may need to prefix the commands with sudo.
  • "grunt server" is primarily aimed being as a useful tool to preview the Adapt course locally when you are building it. A fully-fledged HTTP server like Apache or IIS should really be used to deliver content in production. As Adapt produces HTML, you can just run "grunt build" to compile the course into the build directory and copy all the resulting files to your web server.

Going forward we would really like to create some kind of managed installer (there are discussions regarding this on the forums) and further Adapt command line tools that remove need need for Git completely.