Capstrano3とRuby2.2 on Rails4.2 の設定

2015年10月18日 Posted by PURGE

Capstrano3を使用しようと試しているが、かなりハマっている。
下記は覚え書き。

rbenvでrubyのバージョンが設定されていないエラー

ERROR rbenv: rbenv_ruby is not set

rbenvのパスが検出されないエラー

ERROR rbenv: 2.2.2 is not installed or not found in ~/.rbenv/versions/2.2.2

deploy.rb

## デプロイサーバのパスを記述
set :rbenv_path, '/var/rbenv'
set :rbenv_ruby, '2.2.2'
set :application, 'Sample'
set :repo_url, 'ssh://hoge@whoocus.com/path/to/git/repo/sample.git'

サーバ上でbundleが見つからないエラー

bundle stderr: rbenv: bundle: command not found

サーバ上でインストール。

gem install bundler

JavaScript runtimeが見つからないとのエラー。

JS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.

Gemfile

gem 'execjs'
gem 'therubyracer', platforms: :ruby

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です