使用特定的ruby版本:RVM和bundler

时间:2015-01-07 15:29:13

标签: ruby rvm

我是使用RVM和捆绑包的新手,所以在安装我的捆绑后我遇到了问题。 我创建了一个这样的gemfile:

source 'https://rubygems.org'

#ruby-gemset=starter-d6-susy

#ruby=ruby-1.9.3-p484 

gem "compass", "0.12.2"
gem "sass", "3.2.12"
gem "susy", "1.0.9"
gem "modular-scale", "1.0.6"
gem "compass-recipes", "0.3.0"
gem "zocial", "0.0.3"

并且捆绑安装执行:

Resolving dependencies...
Installing chunky_png 1.3.3
Installing fssm 0.2.10
Installing sass 3.2.12
Installing compass 0.12.2
Installing compass-normalize 1.5
Installing compass-recipes 0.3.0
Installing sassy-math 1.5.1
Installing modular-scale 1.0.6
Installing susy 1.0.9
Installing zocial 0.0.3
Using bundler 1.7.11
Your bundle is complete!

然后当我想用指南针编译我的scss到css时,我得到:

compass watch /var/www/drupal6/sites/all/themes/d6_pf_susy/
LoadError on line ["36"] of /usr/lib/ruby/1.9.1/rubygems/custom_require.rb: cannot load such file -- susy

这是因为系统不使用1.9.3而是1.9.1,据我所知..但我设置了正确的ruby版本:

 rvm use
Using /home/webmaster/.rvm/gems/ruby-1.9.3-p484

我该怎么做才能解决这个问题?如果我把1.9.3没有破折号,为什么会出现错误?

Gemfile syntax error on line 9: no .<digit> floating literal anymore; put 0 before dot
ruby=ruby-1.9.3-p484
              ^
on line 9: syntax error, unexpected tINTEGER
ruby=ruby-1.9.3-p484
               ^

感谢

1 个答案:

答案 0 :(得分:1)

在Gemfile中指定Ruby版本:

ruby '1.9.3'

还可以尝试:

gem uninstall sass
gem install sass

注意:理想情况下,您现在应该使用大于2.1.0的Ruby版本。