Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capistrano-nvm doesn't appear to be working with capistrano-bower #17

Open
ngw opened this issue Apr 28, 2016 · 7 comments
Open

capistrano-nvm doesn't appear to be working with capistrano-bower #17

ngw opened this issue Apr 28, 2016 · 7 comments

Comments

@ngw
Copy link

ngw commented Apr 28, 2016

Hi, I'm deploying a Rails app that makes use of bower and nvm. The problem I'm having now, is that it appears that Capistrano is not running nvm.sh, without being able to find node during bower:install.
Does anyone know what the problem is here?

Capistrano output:
https://gist.github.com/ngw/5e6491071ef1ee364cebcd61b1347d38

Gemfile.lock:
https://gist.github.com/ngw/8b5b862915c288f618cd3420e707b598

Deploy.rb:
https://gist.github.com/ngw/3472dc3a2fac385da3f9c616a8f5a7a8

Does anybody have any idea what's happening here?

@koenpunt
Copy link
Owner

koenpunt commented Apr 28, 2016

You will have to add bower to nvm_map_bins

set :nvm_map_bins, fetch(:nvm_map_bins, []).push 'bower'

@koenpunt
Copy link
Owner

Oh well, I now see you already have that in your deploy.rb

@koenpunt koenpunt reopened this Apr 28, 2016
@ain
Copy link

ain commented May 27, 2016

Same here. I was hoping it could resolve the failure to locate Bower on deploy, but didn't happen :(

set :nvm_map_bins, %w{node npm bower}

and still:

error   27-Mai-2016 11:31:14    Bower not found! You can install Bower using Node and npm:
error   27-Mai-2016 11:31:14    $ npm install bower -g
error   27-Mai-2016 11:31:14    For more info see http://bower.io/
error   27-Mai-2016 11:31:14    Bower not found! You can install Bower using Node and npm:
error   27-Mai-2016 11:31:14    $ npm install bower -g
error   27-Mai-2016 11:31:14    For more info see http://bower.io/
error   27-Mai-2016 11:31:14    Bower not found! You can install Bower using Node and npm:
error   27-Mai-2016 11:31:14    $ npm install bower -g
error   27-Mai-2016 11:31:14    For more info see http://bower.io/

@koenpunt
Copy link
Owner

koenpunt commented May 27, 2016

I'm actually using it with a local install of bower (so one that's defined in package.json), will test with a global install.

@sushant12
Copy link

@koenpunt any plans to resolve this issue?

@ain
Copy link

ain commented Feb 2, 2017

One could also use Bower from devDependencies with a simple script block:

devDependencies: {
  "bower": "~1.8.0"
},
scripts: {
  "bower": "bower"
}

and then call npm run bower <command>.

Good thing for instance, this way, is to install Bower dependencies with npm i where you can just have "install": "npm run bower install" which would then be appended to default npm i call so you get all dependencies covered at once.

@sushant12
Copy link

@ain Thanks. My skill with capistrano is not that good however I will try your solution. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants