search for: rails_env

Displaying 20 results from an estimated 615 matches for "rails_env".

2007 Jan 29
1
rails_env configuration conflict...
I''ve found a conflict in the way the configuration file is handled, in particular effecting the setting of the ENV[''RAILS_ENV''] value. When I attempted to run a worker in production, it would run fine the first time - the second time would fail because it was trying to access the development database. I had created a ''backgroundrb_prodcution.yml'' file that I was passing in when starting up bac...
2006 Jul 05
10
rake migrate RAILS_ENV="production"
On the wiki it says to migrate your DB to production, you can run: rake migrate RAILS_ENV="production" This is taken from: http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations My database is set up with correct MySQL permissions granted and the database.yml is pointing at it. I get no errors when I run it, but equally my production database does not change at...
2006 Jun 19
4
share model definition
I want to share everything about a model except the db connection. Is this a reasonable way to do it? module NotebookDefinition -- Posted via http://www.ruby-forum.com/.
2007 Mar 17
10
a WARNING about cruise task or user-specified build task for Rails
If (like me) you use ccrb to test a Rails app and (like me) you define your own :cruise task, because, for example, you use rspec rather than Test::Unit and (like me) you have the RAILS_ENV ||= ''production'' line in environment.rb (because, like me, you use crummy shared hosting) Your build will run in production mode, possibly screwing up your production database, like mine! (Happily, my crummy shared hosting service has non-crummy database backups, so no l...
2006 Aug 31
2
How to set RAILS_ENV for different directories (fcgid)
Hello! I want to use the same application in two environments (production and development) on the same server (apache2 with fcgid) in different (aliased) directories. Is there a way to specify RAILS_ENV inside my <Directory> directives? I have the line DefaultInitEnv RAILS_ENV production in my httpd.conf but I want one of the directories to be development. Setting the ENV var directly in environment.rb is not an option because I update the production server via SVN but need to keep environm...
2006 Mar 03
2
ENV[''RAILS_ENV''] pb
Hello, I want to put my app in production mode. So I write this line in environment.rb : ENV[''RAILS_ENV''] = "production" I restart webrick. If I write <%= ENV.inspect %> I have the correct "RAILS_ENV"=>"production" But browse my site and look the log, the development.log is still growing and the production.log stay to 0 ko Why ?
2005 Dec 30
0
XP Apache FastCGI ok if RAILS_ENV="", crash when RAILS_ENV="production"
...I Rails 1.0 environment with : - Win XP "Professional" (just brand name) - Apache 2.0.55 (msi) - Ruby for Apache 1.3.1 - Database backend is now Oracle 8.1 Everything run fine with default environment, I''m confused for switching into ''production''. By default RAILS_ENV is null, and my env is like explained by Deme : FastCgiConfig -maxClassProcesses 1 -MaxProcesses 1 -minProcesses 1 -processSlack 1 \ -initial-env PATH="c:/ruby/bin;C:/oracle/ora817/bin;[snip] -initial-env RUBYOPT=rubygems \ -initial-env MAGICK_CONFIGURE_PATH=C:/ruby/lib/ruby/gems/1.8/ge...
2008 Jan 08
5
Different environments in backgroudrb.yml
Hi, Got everything setup nicely with backgroundrb for the development environment and running tests with rspec. However, I have to keep editing the backgroundrb.yml file, to switch between development and testing environment. How can I declare a development, testing and production environment in backgroundrb.yml? Thanks in advance Rai
2010 Feb 18
4
Rails 3 "RAILS_ENV not defined by config/boot" error
I''m running unicorn and unicorn-rails 0.96.1 and the latest Rails 3 beta gem. ?Firing up unicorn_rails spews "RAILS_ENV not defined by config/boot". ?I know this is likely a result of RAILS_ROOT being deprecated?in Rails 3 but I can''t seem to config my way around it. I''m sure other people must have run into this before. ?Is there a quick fix? Thanks
2006 Nov 20
4
Production RAILS_ENV / DB Selection
...ases/20061120100506/vendor/plugins/backgroundrb/server/lib/backgroundrb_server.rb:204:in `run'' script/backgroundrb:29 I then went into the backgroundrb console and basically ran the same code as appears in the RailsBase.initialize() method to init the DB based on the current ENV[''RAILS_ENV''] (which is set to "production" in my backgroundrb config file). The bit that calls establish_connection on ActiveRecord::Base works fine, and seems to connect to the production DB, because I''m able to run manual queries with execute() against it and get results. Howeve...
2007 May 08
8
Running my app in "production" under webrick
hi, uncommenting the line ENV[''RAILS_ENV''] ||= ''production'', in environment.rb makes no difference to my rails app running under webrick, it still runs in development, and i have restarted the server. Does this line only apply to Apache? I dont have RAILS_ENV set, why is it allways running in development? Thank...
2008 Oct 08
9
Plugins and the test environment
Hi guys. I''m writing a plugin for use in the test environment. However, when I run ``rake test'''' or ``rake spec'''', RAILS_ENV is set to "development" when my plugin''s init.rb is run. How do you configure a plugin to load require a file in the test environment? Thanks, Nick --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups &q...
2007 Dec 26
2
How to set environment when calling rake task inside another
This is what I have inside a rake task. In this rake task I need to call another rake task called email:send_messages. However I need to pass the RAILS_ENV as ''staging''. Rake::Task["rake:email:send_messages"].invoke I tried a lot of variations but none of them work. Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging Rake::Task["rake:email:send_messages RAILS_ENV=staging"].invoke Any thou...
2006 Feb 01
3
Getting database config info
Hi folks. I have a very small problem which is probably very simple. But I''ve scoured the api and the rails book with no luck. I''m trying to get information about the database definition out of active record. When I go into console and say ActiveRecord::Base.connection I get a MysqlAdapter object, with an instance variable called @config that''s a hash containing all
2009 Sep 22
6
Import excel / csv files
Hey, What way is the best to do imports of CSV files?
2005 Mar 17
4
Specifying Which Environment I Am In
After I have uploaded my app where do I specify that my app should now use production environment settings and not development? Can that be done dynamically so that I don''t have to reset a value once I upload website? Thanks for your help!
2006 Oct 14
1
Setting environment
Not sure this is known behaviour but it seems that if want to set the environment to, for example, test, and you want to use Active Record you have to both explicitly set the RAILS_ENV and the BackgrounDRb environment. So, if you have a config file backgroundrb_test.yml (as well as the default) and set the environment to test in that, this is what *seems* to happen: $ script/backgroundrb/start # starts backgroundrb in development environment and uses AR in development...
2006 May 25
2
Capistrano only runs migration against production env?
All, Just read in the Capistrano manual about the Capistrano "migrate" task. There it says that: "By default, all this task does is change to the directory of your current release (as indicated by the current symlink), and run rake RAILS_ENV=production migrate. You can specify that it should run against the latest release (regardless of what the current release is) by setting the migrate_target variable to :latest before invoking this task. Likewise, if you want to specify additional environment variables (beside RAILS_ENV) you can...
2007 Feb 12
1
-c switch in the startup command
I have been strugging with getting backgroundrb to stay in the correct environment using multiple configuration files and the -c switch when starting backgroundrb. If I start brb like this: ./script/backgroundrb run RAILS_ENV=development -- -c ../config/development_background.yml where development_background.yml specifies "development" for rails_env and environment, the first worker created does, in fact, use the development environment. But on the second request, the configuration details from backgroundrb.y...
2006 Feb 10
1
Setting RAILS_ENV before running script/server in the comma
I want to set an environment variable before running a script for example setting ENV[''RAILS_ENV''] = production in the command line before running script/server so that it would start in production mode. Is there a way to do this from the command line so that I don''t have to modify the file? Thanks, Brian -- www.kenlet.com