Install Ruby/Rails + Compass/Sass on Ubuntu
This is the quick and easy way to get up and running with Sass on Ubuntu. Sometimes it can be a slight pain when you need to get the right versions to work with each other. There is much help out there in the interwebz if you run into this problem. However, as noted on the end, if you have a project already configured, there is a workaround for this.
Step-by-step guide
Install RVM
sudo apt-get update
- sudo apt-get install curl
- \curl -L https://get.rvm.io | bash -s stable
- source ~/.rvm/scripts/rvm
- rvm requirements
Install Ruby
rvm install ruby
- rvm use ruby --default
- rvm rubygems current
Add this to your ~/.bashrc
export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
- Close your terminal window and open a new one
- sudo chown -R $USER /var/libs/gems/
- gem install rails
Install Sass
- gem install sass
Install Compass
- gem install compass
Install Dependencies (these are just example gems, easier to just do bundle install in your project, see NOTE)
- gem install breakpoint
- gem install bootstrap-sass
NOTE: As stated above, when you go into an existing project, it may not like the default setup. Fortunately, there is a simple workaround for this. It will give you an error like:
Could not find proper version of compass (0.12.2) in any of the sources
Run `bundle install` to install missing gems.
Just run bundle install and you will be good to go.
Related articles