2

I have a application I am trying to host on the cloudcontrol server, but the issue is I need the gem -v to be 1.3.7.

I have tired:

cctrlapp APPNAME/default run "gem install rubygems-update -v 1.3.7
cctrlapp APPNAME/default run "gem update --system 1.3.7

But after all this on running cctrlapp APPNAME/default run "gem -v I get 1.8.24. So my question is, how do I downgrade my gem version?

Shouvik
  • 11,350
  • 16
  • 58
  • 89
  • Every time you execute cctrlapp run, a seperate container gets spawned and installing something in it has no effect on the other containers (https://www.cloudcontrol.com/dev-center/Platform%20Documentation#non-persistent-filesystem) – Stefan Friesel Jul 05 '13 at 23:04
  • Hmm, that I kinda figured after a couple of attempts :) I was wondering if there was a way make the change take effect. – Shouvik Jul 05 '13 at 23:45

1 Answers1

1

cloudControl is using bundler to manage the gems.

You need to specify the version in your Gemfile. Make sure it's also used in Gemfile.lock after running the 'bundle install' command. Note that the Gemfile.lock needs to be included in your git repository.

When you push the next time, this version will be used. You can see this in push command's output, e.g. 'Installing rubygems-update (1.3.7)'. After the next deploy, you can also verify it via run command (e.g. cctrlapp APPNAME/default run 'gem list').

Stefan Friesel
  • 823
  • 5
  • 19
  • okay that get's the gem file on my machine but still doesn't actually update the system to 1.3.7. For that I need to also get bundler or something similar to run `sudo gem update --system -v 1.3.7`. Any idea how I can trigger that? – Shouvik Jul 08 '13 at 15:05
  • I tried your suggestion and got the gem declared on gemfile. then tried `cctrlapp appname/default run "REALLY_GEM_UPDATE_SYSTEM=1 gem update --system 1.3.7"` alas ended up with error `ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /var/lib/gems/1.9.1 directory.` – Shouvik Jul 09 '13 at 18:59
  • Running a command like this would even if it worked only change the filesystem temporary for the run-time of the current container (remember, each run command is always executed in a dedicated and temporary container). So what you need to do is push the changes to the gemfile, so that during the next push the buildpack can install the new version already in the image which is then used to start all the containers. – pst Oct 03 '13 at 13:58