I am trying to deploy rails app through chef . code deployed successfully ,but bundle install throwing error for specific gems , When installed manually gem installs without any issues , as per the chef error i got to know that , to execute bundle install chef uses its embedded ruby version and path for the same , but system is installed with ruby 2.0 using rvm .Can we override the chef ruby path to system ruby path ? I am using following code to deploy ,
deploy_branch "master" do
repo repo_url
migrate false
action :deploy
branch 'master'
enable_submodules true
before_migrate do
current_release_directory = release_path
running_deploy_user = new_resource.user
bundler_depot = new_resource.shared_path + '/bundle'
excluded_groups = %w(development test)
script 'Bundling the gems' do
interpreter 'bash'
cwd current_release_directory
user running_deploy_user
code <<-EOS
bundle install --quiet --deployment --path #{bundler_depot} \
--without #{excluded_groups.join(' ')}
EOS
end
end
end