From owner-freebsd-questions@FreeBSD.ORG Mon Mar 16 15:39:42 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D8F410656D6 for ; Mon, 16 Mar 2009 15:39:42 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id 542FC8FC23 for ; Mon, 16 Mar 2009 15:39:42 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 44851 invoked by uid 89); 16 Mar 2009 15:40:05 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 16 Mar 2009 15:40:05 -0000 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <751DE4C1-73B1-4430-8373-A57B59676BBC@identry.com> Content-Transfer-Encoding: 7bit From: John Almberg Date: Mon, 16 Mar 2009 11:39:40 -0400 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.753.1) Subject: Re: links vs real directories X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 15:39:43 -0000 On Mar 16, 2009, at 11:22 AM, John Almberg wrote: > I always thought that links to real directories were pretty much > the same as real directories, but I've just discovered a situation > where they are not and I'm wondering if I'm doing something wrong... > > I have a Ruby on Rails application running on a FreeBSD server. All > Rails apps use the same directory structure, that consists of an > application directory, plus a number of subdirectories. One of > these sub directories is called 'config'. > > I would like to move this config directory out of the main Rails > app directory, and then add a link from the app directory to the > moved config directory. > > so: > > app --> config > > will become > > app --> config(link) --> config > > Basically, what I'm doing is: > > cd ~/app # now in directory with real 'config' dir > mv config ~/shared/config > ln -s ~/shared/config config > > That moves the directory and creates a functional link to it (I > tested it), but Rails doesn't like it and refuses to run the app. > The permissions are correct, I believe: > > [master@on:current]> ls -l > total 34 > ... snip ... > drwxrwxr-x 3 master master 512 Mar 16 11:06 bin > drwxrwxr-x 3 master master 512 Mar 16 11:06 components > lrwxr-xr-x 1 master master 26 Mar 16 11:07 config -> /home/ > master/shared/config > drwxr-xr-x 4 master master 512 Mar 16 11:06 db > etc... > > > So, I guess a link is NOT exactly equivalent to a directory. At > least not the way I am doing it. > > I'm guessing I'm making a real newbie mistake, so if anyone can set > me straight, I'd appreciate it. > > Thank: John > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions- > unsubscribe@freebsd.org" A little more information on this... from the Rails log, I can see that a Ruby script in the config directory cannot load ('require') a needed file because it can't find it: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- application (MissingSource File) It looks like this require statement is using a relative path, like '../path/to/file'. Does '..' not work properly with a soft link? In other words, '..', should mean ~/app, but since the config directory is really in '~/shared', perhaps '..' translates to '~/shared'? That would cause the problem finding the file. Is there a way around this problem? Digging in man ls, right now.. -- John