Issue with creating a gemset via Chef - .ruby-gemset and .ruby-version not getting created

59 views Asked by At

I have included rvm --create --ruby-version ruby-2.3.3@storesview in my recipe to create a gemset. Running the kitchen converge does not result in the creation of .ruby-gemset and .ruby-version. But when I run rvm --create --ruby-version ruby-2.3.3@storesview directly on the VM terminal, the files are getting created. What could be the reason? Thanks. Here's what my bash code looks like :

bash "somename" do
  user 'root'
  cwd "/var/www/html/APIStoresView/"
  code <<-EOH
    rvm --create --ruby-version ruby-2.3.3@storesview
  EOH
end
1

There are 1 answers

2
coderanger On BEST ANSWER

In general use of rvm on servers should be discouraged, and Chef+rvm is dicey at the best of times. More specifically, appbundler (used by Chef to create marginally bullet proof binary stubs) sets a lot of environment variables that can confuse rvm.

If you need a specific version of Ruby for a project, I would highly recommend using poise-ruby+poise-ruby-build and Bundler rather than rvm and gemsets.