capistrano / capistrano/rails

Capistran/Rails doesn't work with rvm

Open
#207 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
901
Forks
262
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Capfile entries for capistrano/rvm and capistrano/rails, then trace the remote execution of `bundle exec rails webpacker:install` under the configured RVM user and gemset. Reproduce the reported `bash: bundle: command not found` error and determine whether the integration can make the configured bundle available; done means the command runs with the selected RVM environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.