Reputation: 4648
I'm deploying an app using Elastic Beanstalk and part of the app has a grunt task that runs "sass", I have sass being installed but it is being installed locally and thus isn't part of the PATH
, so the grunt task fails.
I just attempted adding a command
to the beanstalk config that does sudo gem install sass
but that fails with Command failed on instance. Return code: 1 Output: sudo: sorry, you must have a tty to run sudo.
What would be the best way to get sass into the PATH? There didn't seem to be an easy way to update the PATH / set the .bashrc with elastic beanstalk
Upvotes: 2
Views: 714
Reputation: 18926
Using ebextensions commands is the way to go. You don't need sudo, as the commands run with the necessary privileges.
Also looks like you are using node solution stack (since you mentioned grunt). There may be multiple versions of ruby on your instance. You want to be sure to use the right gem binary so your dependencies are installed in the right location.
There is a ruby installed in /usr/bin
and another one in /opt/elasticbeanstalk/lib
. The latter is used by Elastic Beanstalk which is not what you want. You want to run the gem binary under /usr/bin
.
Upvotes: 3