Installing Compass & Sass on Dreamhost - sass

I would like to get going with Compass and Sass on my Dreamhost webspace. Unfortunately it is not part of the provided standard gems so the installation appears to be more complicated. Does anyone have hands on experience with installing and running Compass and Sass on Dreamhost?
I'd appreciate any guidance.

I was facing a similar challenge - installing Sass/Compass on dreamhost shared account - but was able to figure out how to do it. I used these instructions for installing my own copy of RubyGems (although I'm not completely sure that was necessary). Then I just used the following two commands to install sass and compass:
gem install sass
gem install compass
It all went pretty smoothly.

One option is to just precompile your sass (compass compile) on your machine and then upload just the CSS, so you don't actually need compass installed there.
Or, if you're in a ruby project, use bundler. It will install the gems under the project.
If you're using a Dreamhost VPS (I would recommend it over the shared hosting) then you also have sudo access, and you can install it globally by logging in as an admin user (set this up in the panel).

Related

Is it possible to install bundler using bundler --standalone

I know this may sound weird - maybe like search for "google" using google - but I'm fighting with a problem using the standalone feature of bundler.
Background:
I'm creating a rpm for "single click" installation of a rails application. What I don't want is to build all the necessary gems on the target server - I want to deliver them within the rpm file.
So I did the "hack" using
bundle install --standalone default --binstubs bin/
But rails require bundler. Shure there are ways to remove bundler from rails - but this isn't easy in an grown application. So I don't have a problem with using bundler in my production setup.
But bundler won't install bundler to the standalone folder - and I couldn't figure out how to do this
Is there a way to work arround this? Or is there a better way without building the gems locally and without refactoring the rails app?

How do I list required gems for my system, so they are installed automatically when deploying it?

I am new to Ruby but I really enjoyed it.
I used Aptana Studio 3 as an IDE, but I feel it lacks support (even though I installed the undle). When I created a Ruby project, there were no files inside it.
I added a test.rb file and started playing with it.
Now I hav a simple project in which I needed to install some gems. To do so I opened the CMD, navigated to my project's folder and issued the command "gem install xxxx". On my test.rb I include the gems using require 'xxxx'.
What is the best practice to add gems?
If I ever wanted to deploy this application, I would need to add the gems to my production server. Is there any way I can list the required gems so that the server intalls it automatically when I run deploy the application?
thanks!
Put them in a Gemfile, it is used to manage the gem required by an application.
http://bundler.io/v1.3/gemfile.html
It might depend on where you are deploying to but I like to use Capistrano for deployment. Capistrano will install the gems for you by running bundler which reads your Gemfile.
Also checkout bundler. It will read your Gemfile (create one if you don't have one). To install your gems it is as simple as:
$ bundle install

How to install Compass on Windows

I have installed Ruby on my system, and now I want to install Compass. But when I execute the gem install compass command, it shows an error like this:
could not find valid gem 'compass' <>=0> in any repositary
And also:
SocketError: getadressinfo: no such host is known.<http://rubygems.org/latest_specs.4.8.gz>
I don't know what the problem is. If I run ruby -v, it shows the Ruby version. So what's the problem with installing Compass?
Can anyone explain this to me properly? I've searched Google, but all I could find was some proxy problem - and I couldn't understand how to set the proxy at all.
I'm using Windows and a company internet connection, so I don't know the username and password of my proxy.
I was behind a proxy and HumberFrench's solution above helped:
Go to Ruby bin folder:
cd c:/Ruby193/bin
And then install compass gem:
gem install compass --http-proxy http://<proxy_adreess>:<port_of_proxy>
Another tip: am on Aptana Studio, so this could be run from within Aptana's terminal.
Cant up-vote so adding this here.
I had the same problem, finally solved it manually.
Goto the rubygems compass page, and download the gem by clicking the Download link. Scroll down and you will see three Runtime Dependencies. Goto each of them and download those gems also. Put all of them in a directory, and try
gem install downloaded_compass_filename
This should solve your problem.
If it gives an repository not found error message, you can force gem to try local files through the gem --local install option
if you use a proxy, and get error, do it
gem install compass --http-proxy http://<proxy_adreess>:<port_of_proxy>
gem install -h gives you a lor of options
The proxy is the most likely cause. You will have to get permission from the network admin, or manually download compass. For more info, See this SA post.
If you decide to go the manual route here is a link to the RubyGems compass page. This not ideal, but also better than having to write css without compass magic ^^
Good luck!
On windows i had a few instalations of ruby:
C:\ruby187
and
C:\Ruby200-x64
install compass in both places, using:
gem install compass
Try running the install command in the bin folder.
$ cd C:\Your_Ruby_Folder\bin
$ gem install compass
I have same problem and i resolve it with.
Uninstall ruby end deleted folder ruby
Download ruby version 1.9.x
After thet install sass
last stem: install compass

after running bundle install with rubymine still gems are missing

I started a new rails application project with rubymine.
After that Rubymine ran a bundle install.
project did not succeed in running
on one project - with no mysql definition the error is
gemnotfound - could not find gem sqlite
on one project - with mysql definition the error is
gemnotfound - could not find gem mysql2
Does someone have an idea what are those ?
shouldnt bundle install brought me those?
How can I start a simple rails project using rubymine?
Is there a good tutorial with all these issues ?
Thanks you.
RubyMine may not be able to install these gems automatically as they depend on native libraries that may not be available on your system. You also need DevKit installed and working in order to install native extensions.
I suggest you to read related posts:
Cannot install mysql2 gem
Installing SQLite 3.6 On Windows 7
You can also use sqlite-ruby instead, as for the above gems you need sqlite3.dll and libmysql.dll in PATH.
Google is your friend, it's not that hard to find various installation guides.

Easiest way to get Compass/Sass running on OSX

I first had to follow the instructions here to make sure that I had Ruby and Gems installed. Then I installed compass using Gems.
Then I tried to run compass and had some errors...
"Warning: Unable to load CarbonCore.
FSEvents will be unavailable compass"
I found a solution here, but it required me to install RVM via gems first and then following the instructions in the link above.
Is there an easier way to setup/run compass/sass on OSX?
This problem is described in the compass issue tracker. It's not a showtopper because it falls back to another (less efficient) method of watching for file changes that doesn't depend of fsevents. Still, it would be nice to fix, right?
Since you compiled your own version of ruby, you need to enable shared libraries for it as well. This is described on the rubycocoa getting started page.
More details can be found in this google groups discussion, particularly the advice from Brandon Mathis.
Installing last version of Compass gem (0.11.5) seems to solve the problem:
gem install compass
You have to update your gems:
sudo gem update –system

Resources