Question

Can someone explain why the short path in my config.rb file isn't compiling:

require 'zurb-foundation'  # it fails

But when I specify the full path it does:

require "/Users/lukashillebrand/.rvm/gems/ruby-1.9.3-p327/gems/zurb-foundation-4.2.2/lib/zurb-foundation.rb";

I'm using CodeKit to compile and Foundation 4

Was it helpful?

Solution

The reason is that CodeKit is apparently using the system ruby, and so the relative path is looking there. Your full path is pointing to an rvm version, which is installed elsewhere.

The quick fix is temporarily switch rvm to the system ruby & gemset, and install zurb-foundation there:

$ rvm system
$ sudo gem install zurb-foundation

OTHER TIPS

I do not know zurb, just Ruby as a language/platform, and I think that if that first 'require' throws, then most probably some paths are not set up properly in your server environment.

Is Zurb distributed as a gem? Are other gems found well and are require'able by your code? If not, or if you don't know, try adding

require "rubygems"

as the very first line of your code (well, after some initial shebang and other comments). It should normally be invoked by the framework, somewhere before your file, but as I already said, I don't know Zurb. Maybe it simply does not do that for performance reasons.

Also, run some simple file in the same environment and inspect the $: variable, it should show you the paths that are searched for modules. If in very deadline'y times, you can even temporarily push a new path to it (just replace the '.' with your target path), but it'd be best left as a last resort. Your zurb module seems to sit in Gems, so it should be found automatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top