Jared Beck, 2012-09-05
-
Couldn't deploy because bundler says: gem says: sass "requires ruby >= 1.8.7"
-
Confirmed that production host was running 1.8.6
$ dpkg --get-selections | grep ruby ruby1.8 install $ dpkg -L ruby1.8 /usr/bin/ruby1.8 $ /usr/bin/ruby1.8 --version ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
-
Unable to sudo .. need a sudoer
- Using the slicehost control panel, reset the root password
- Create a singlebrook user, grant sudo, grant ssh access
-
Try to get 1.8.7 through APT
sudo apt-get update
whines because it's ancient- Ruby 1.8.7 is not available via apt-get
sudo apt-get install ruby1.8
acts like it's upgrading, but doesn't/usr/bin/ruby1.8 --version
is unchanged
-
Install from source
-
Success
$ ruby --version ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux]
-
However, /bin/ruby1.8 is still in place (that's 1.8.6, from APT)
sudo apt-get remove ruby1.8
-
Also, gem is outdated (1.3.7)
- Installed gem from source
sudo gem install bundler
-
Almost done, things are looking good
$ ruby --version ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux] $ gem --version 1.8.24 $ bundle --version Bundler version 1.2.0
-
Move defunct binaries to the lost+found
$ /usr/bin/gem --version -bash: /usr/bin/gem: /usr/bin/ruby1.8: bad interpreter: No such file or directory $ /usr/bin/bundle --version -bash: /usr/bin/bundle: /usr/bin/ruby1.8: bad interpreter: No such file or directory $ sudo mkdir -p /lost+found/20120905/usr/bin $ sudo mv /usr/bin/gem /lost+found/20120905/usr/bin $ sudo mv /usr/bin/bundle /lost+found/20120905/usr/bin
-
The deploy gets past the
bundle
part now, yay! But:*** [err :: ggchapters.org:7722] /usr/bin/env: *** [err :: ggchapters.org:7722] ruby1.8 *** [err :: ggchapters.org:7722] : No such file or directory
-
So,
sudo ln -s /usr/local/bin/ruby /usr/bin/ruby1.8
-
Now the deploy gets past
deploy:update_code
, but:*** [err :: ggchapters.org:7722] /home/joe/www/staging/shared/bundle/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
-
The above error is well known, see here and here
- Basically we must either downgrade gem below 1.6, or upgrade rails to 2.3.11 or higher.
- The rails upgrade was ready to go in branch rails-2-3-14
- Therefore, I decided to merge branch rails-2-3-14
-
cap staging deploy
is now successful -
However, passenger stopped working. And that's when it all fell apart.
- I "un-merged" the rails-2-3-14 branch,
- removed sass,
- downgraded gem to 1.4.2,
- and reinstalled 1.8.6 from APT
- I haven't removed the 1.8.7 installed from source
- That got passenger stared again ..
I don't know how to configure passenger to run on the ruby 1.8.7 that I installed from source. Passenger is definitely looking for ruby source files in the old places; the 1.8.6 places. So, we can either:
- learn how to configure passenger to use the ruby 1.8.7 that I installed from source, or
- learn how to get 1.8.7 through APT
Either way, without 1.8.7, we can't install sass, so for now we'll have to commit the compiled stylesheets into source control.