0

after I finally managed to get Compass running on my hosted web space (no root access), there is a new problem when trying to install bootstrap-sass:

$ compass watch
LoadError on line 31 of /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: no such file to load -- bootstrap-sass

gem install bootstrap-sass
ERROR:  Error installing bootstrap-sass:
        execjs requires Ruby version >= 1.9.3.

Well, it is quite obvious what's going on: I need Ruby >= 1.9.3 while the server only offers 1.8.7. I already checked: It is not possible to use another ruby version on this server.

Is there any way/hack/solution to use bootstrap-sass?

Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
  • `1.8.7` was released in 2008, was supported until 2012 and since 2013 there are [no security updates anymore](https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/). Btw even support for `1.9.3` [has ended months ago](https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/). If your hoster does not support newer versions of Ruby, then you should run and find another hoster... – spickermann Nov 19 '15 at 10:41
  • This is absolutely correct. But right know I need a solution that could work under these given circumstances. – Andrei Herford Nov 19 '15 at 11:09

2 Answers2

1

When a gem depends on a specific (or newer) version of Ruby, then the reason is usually that the gem depends or uses a feature that did not exist in older versions.

There are many differences between Ruby 1.8.7 and 1.9.3: The new hash syntax, better UTF8 support and new methods or methods with changed behavior - just to name a few.

When a gem was build for 1.9.3 and you want to use tat gem with an older version, there is IMHO only on option: Fork that gem, review the source code and rewrite everything that is not compatible with 1.8.7.

You will very likely learn that such gems depend on other gems that also depend on more up-to-date versions of Ruby. Do the same for that gems...

Community
  • 1
  • 1
spickermann
  • 100,941
  • 9
  • 101
  • 131
0

I totally agree that still using Ruby 1.8.7 is not a good idea. I am not sure why my hoster still uses a version this old, but it is simply a fact I cannot change. Sure, I can move to another hoster but for now I was able to find a working solution. Maybe someone else has the same problem. So this worked for me:

gem install bootstrap-sass did not work because it requires execjs and the latest version requires Ruby > 1.9.3. Gladly bootstrap-sass does NOT require the latest version of execjs. So the solution is simple: Install a previous version of execjs which is happy with ruby 1.8.7:

gem install execjs -v 2.5.0
gem install bootstrap-sass
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225