How to downgrade Rails from 2.0.0 to 1.9.3 and update Unicorn config?

June 17, 2014 2.5k views
Hi. Currently the droplet started with application rails image has ruby 2.0.0 and rails 4. I'm trying to downgrade but haven't been able to do so. Basically my steps were: * rvm install 1.9.3 * set 1.9.3 as default with rvm * updated GEM_PATH, GEM_HOME and DAEMON paths in /etc/init.d/unicorn as following: export GEM_HOME=/usr/local/rvm/gems/ruby-1.9.3-p547 export GEM_PATH=/usr/local/rvm/gems/ruby-1.9.3-p547:/usr/local/rvm/gems/ruby-1.9.3-p547@global DAEMON=/usr/local/rvm/gems/ruby-1.9.3-p547/bin/unicorn Error I get: 1. /usr/bin/env: ruby_executable_hooks: No such file or directory 2. I was also getting something like "unable to stat ... "
1 Answer
After you install 1.9.3, make sure you also install the necessary gems that we installed system wide for 2.0.0. Use rvm to switch back to 2.0.0 and run gem list to see the full list of gems that were installed system wide for the default install. The key one is of course unicorn. Also make sure you update the value for PATH in the unicorn configuration file at /etc/default/unicorn
Have another answer? Share your knowledge.