Search code examples
sproutcore

Difference between sproutcore and sc-init


What is the diference between the commands:

sproutcode gen app AppName

and

sc-init AppName

When I'm running the first one I see the following:

~ Created directory at apps
WARN 22:36:15.009 ~ For specific help on how to use this generator, type: sc-gen statechart_app --help 
FATAL 22:36:15.009 ~ Permission denied - /var/lib/gems/1.8/gems/sproutcore-1.9.1/lib/apps

If I use the second command sc-init it works fine and the application is created in a folder I made.

In order to make sproutcore to work I add sudo in front of it and the applications I create this way are stored in /var/libs/gem.

How can I use the sproutcore command without using sudo in front of it and also point it to save the application in my desired folder?


Solution

  • I would highly recommend that you read the Sproutcore Build Tools Guide to get a good overview of what they offer and each command's purpose.

    sproutcore init (or sc-init for short) is designed to generate a full Sproutcore project with multiple apps inside of it. Whereas sproutcore gen app AppName is designed to generate an app in an existing project.

    I think your problem with sproutcore gen is that you are running it outside of a project, so it's defaulting to the base project directory which happens to be part of the gem, which you do not have access to (well...without using sudo that is).

    I bet if you use sc-init to create the project, cd into the directory, and then run sproutcore gen app MyAwesomeApp it will work as you expect.

    But definitely check out the guide I linked above as it will walk you through the whole process.