similar to: Why is RAILS_ROOT so roundabout?

Displaying 20 results from an estimated 300000 matches similar to: "Why is RAILS_ROOT so roundabout?"

2006 Feb 17
3
How to get RAILS_ROOT when writing a ruby utility in /lib
Hi, Im writing a small ruby utility which at the moment is in /lib of my rails app. However I don''t get access to var''s like RAILS_ROOT, do I need to add an include to get this (and possibily other) rails functionality? Is /lib the right place for this kind of app, its a single ruby class which I call from the command line. Would a rake file be better for this kind of
2006 Mar 25
3
RAILS_ROOT Help Required!
Hi, I am new over here and also a newbie for Ruby on Rails. I am working on a simple webapp for my band work. I have created a upload controller/model and database which allows to save my files in the directory at /public/dump/. Uploading works but I can''t retrieve it. I have tried several ways. The model uses DUMP_PATH = RAILS_ROOT + "/public/dump" to save the file. But
2006 Apr 13
1
Setting CWD to be RAILS_ROOT for fastcgi/Apache
All, So I''ve discovered that when running on FastCGI with Apache and the working directory for the process is actually the "public" directory under RAILS_ROOT. Is there a way to force the current working directory to be RAILS_ROOT for the FastCGI procs so that file manipulation would then be done relative to RAILS_ROOT? Or should I just make sure that all of my paths are
2006 Jun 29
0
RAILS_ROOT
Hello everybody: I am new and i have a small problem with ruby. I want to execute an external program and I need to pass as an argument to that program a file of the system. I''ve got that file in the public/files folder of my rails folder tree. How can I know the path to where I have my rails project? I thought this would be with RAILS_ROOT but this variable is
2006 Apr 30
1
storing sessions in RAILS_ROOT/tmp
I''ve read that the newest versions of rails stores sessions in rails_root/tmp. I''ve been running off the trunk for about 3 months, but I still have all of my sessions stored in /tmp of the file system. What do I need to do to modify it so that my sessions are stored in my rails_root/tmp folder? -- Posted via http://www.ruby-forum.com/.
2006 Jun 28
6
file_column plugin. Storing files outside RAILS_ROOT
I also posted this on Rails Engines forum. Sorry for the double post. I am trying to configure file_column plugin so that it stores the images in a directory completely outside of RAILS_ROOT. I have no problems in storing the files by setting :root_path option. But I can''t get to display these images using ''url_for_file_column''. What I get instead of the image is
2006 Apr 26
2
Routing to a static HTML file under RAILS_ROOT
I have a regular plain old static HTML file under my RAILS_ROOT that I would like to serve as itself (without any dynamic anything). How can I write a route to "pass the request through" succesfully. I tried map.connect ''path_to_file'', :controller => nil, :action => nil, :id => nil but that didn''t work. Also, note that I have this route
2007 Oct 24
4
RAILS_ROOT
Hey, I''m using the attachment_fu plugin to upload images on the file system. To retrieve them I''m using: image = "/home/rajeev/Desktop/logo/logo/public#{icon.public_filename}" which is the same as: "/home/rajeev/Desktop/logo/logo/public/icons/0000/0005/green_nature_on_white.jpg" Have can i do this in a shorter way by using RAILS_ROOT? I have tried this
2006 Oct 09
1
error running 'ruby script/console' => "uninitialized constant RAILS_ROOT" ??
Hi, Anyone suggest why when I try to run the console via ''ruby script/console'' I get the following "uninitialized constant RAILS_ROOT" ?? Error: ================================ V:\Source\testapp>ruby script\console Loading development environment. ./script/../config/../config/environment.rb:3:NameError: uninitialized constant RAILS_ROOT
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in the browser. <h1>New member</h1> <%= error_messages_for :member %> <% form_for(:member, :url => members_path) do |f| %> <fieldset> <legend>Member Info</legend> <p><label for="member[first_name]">First Name:</label> <%=
2007 Jul 26
1
autotest loosing RAILS_ROOT Constant?
I am having a weird error that I have not had before... I''m bouncing it off the list to see if anyone else has had it, or to give me some pointers about how to find it. Basically, AUTOTEST will run (RSpec mode), fine, then suddenly, will complain that RAILS_ROOT is undefined. Then I stop and restart it, with no code change... no problem. It happens on different specs where I use
2007 Jul 24
1
Why can''t find index file sometimes?
I''m using ferret and acts_as_ferret,i can success save record,but sometimes when i update record,index not found error occurred(not always).I don''t know why:( [quote] File Not Found Error occured at <except.c>:117 in xpop_context Error occured in fs_store.c:329 - fs_open_input tried to open "/home/dev/www/index/development/rcu/_12q.cfs" but it doesn''t
2006 Feb 20
3
RAILS_ROOT
I just replied to someone about using send_file and while I was testing my solution I figured out that the controllers "current working dir" appears to be the root of the app. Then I saw a reply that Ezra sent to someone where he used RAILS_ROOT and I thought "duh, I''ve seen that before... shoulda used that". But, when I had an action print out RAILS_ROOT
2010 Dec 12
1
In Test/Unit Dir.glob is Rails root but to require a file must assume "Rails_root/test/"
I am wondering why this is: In Test/Unit I am iterating a directory so that I can require each of the files in the directory. When I call Dir.glob, the root is the Rails_root, however when I iterate the files I get an error if I use Rails root and must begin the included file''s path from within the test directory. This: integration/helpers/file.rb And not
2007 Dec 21
0
rake test:plugins gives uninitialized constant RAILS_ROOT
Hello, Just upgraded to the the latest backgroundRb.I am getting an error when i run the task "rake test:plugin". Any idea why I am getting this? Here is the error message: /usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake_test_loader.rb" "vendor/plugins/backgroundrb/test/master_worker_test.rb"
2007 Feb 11
4
Let's make RAILS_ROOT an absolute path on Windows
As this Caboose article [] suggests, I am not the only one who had this problem. RAILS_ROOT is a relative path on Windows, and it can bite you in unexpected ways. I had that problem while working on CruiseControl.rb. There is a trivial patch fixing it (by simply applying File.expand_path to the path before assigning it into the RAILS_ROOT constant): http://dev.rubyonrails.org/ticket/7259 Best
2006 Aug 14
0
ActionMailer in an infinite loop? Looks like framework bug.
I would rather post this on the dev list since it looks like only the developers can explain why this is failing. However, I can''t find where you subscribe to it! Any ideas? Here is my problem. Whenever I try to send an email I get a SystemStackError saying stack level too deep. Here is the exception trace:
2006 Aug 14
1
AWDWR Chpt6: Webrick Get...200... then ...500...
Hi, Rails produces to diff Gets on the Webrick: AWDWR Chpt 6 strange results: First browser call to /Admin shows correct form; - And WEBrick reports: "Get /admin HTTP/1.1" 200 485 - -> /admin Subsequent browser calls to /Admin show: NoMethodError in AdminController#index undefined method `each'' for #<Mysql:0x37aba80> - And WEBrick reports: "Get /admin
2006 Jun 04
4
"can''t convert Magick::GravityType into Integer"
Am having trouble with file_column -- on certain crop operations, it says: A TypeError occurred in [controller]#[action]: can''t convert Magick::GravityType into Integer [RAILS_ROOT]/vendor/plugins/trunk/lib/magick_file_column.rb:90:in `crop'' Any advice? Here''s the backtrace: [RAILS_ROOT]/vendor/plugins/trunk/lib/magick_file_column.rb:90:in `crop''
2006 Jun 18
2
Why can''t I use a session? (Symbol as array index)
Hi All I can''t for the life of me see what is wrong with this. Maybe it''s cause it''s midnight... I want to put some data in a session and I have some code like this: class ApplicationController < ActionController::Base model :mything def ApplicationController.chosen_thing session[:chosen_thing] ||= MyThing.defaultThing end end So whenever I try to