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

Capistran/Rails doesn't work with rvm #207

Open
Deimos620 opened this issue Sep 13, 2017 · 4 comments
Open

Capistran/Rails doesn't work with rvm #207

Deimos620 opened this issue Sep 13, 2017 · 4 comments

Comments

@Deimos620
Copy link

I am trying to deploy Rails app with capistrano.
Ruby version is managed by rvm.
I am using ruby 2.2.3, created gemset manually.

 set :rvm_type, :user
 set :rvm_ruby_version, '2.2.3@cardlove-api'
 ...
 with RAILS_ENV: fetch(:environment) do
              execute :rake, "webpacker:install"
 end

So, it seems worked. But when Rails > 5.0, webpack should be installed by this command:
bundle exec rails webpacker:install
(instead of bundle rake)

 with RAILS_ENV: fetch(:environment) do
              execute :rails, "webpacker:install"
 end

But it doesn't work for me. I've installed bundle in the gemset I am using, but getting error:

01 bundle exec rails webpacker:install
  01 bash: bundle: command not found
 (Backtrace restricted to imported tasks)
  cap aborted!
  SSHKit::Runner::ExecuteError: Exception while executing as user@IP: rails 
  exit status: 127
  rails stdout: Nothing written
  rails stderr: bash: bundle: command not found

Of course, I included capistrano/rails in my capfile.

...
capistrano/rvm
capistrano/rails
...

I am not sure why I am getting error. I think I configured correctly , but...
Anyway, Would you like to help me to fix this issue?

Thanks.

@will-in-wi
Copy link
Contributor

Do you have capistrano/bundler in your Capfile?

@mensfeld
Copy link

I would close it. No activity and for me works as expected with this combination.

@Deimos620
Copy link
Author

Yes. I have it in my Capfile.

@mattbrictson
Copy link
Member

mattbrictson commented Nov 21, 2017

I would try execute :rake, "webpacker:install" (i.e. rake instead of rails)

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