views:

18

answers:

1

link text

I tried all of the answers from the above stack overflow post but none of them worked

When I replace the #!/usr/bin/env ruby with the #!/path/to/my/script/runner and try to run

Rails returns:

/var/www/cmgmail/production/releases/20100810151610/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in establish_connection': Please install the postgresql adapter:gem install activerecord-postgresql-adapter(no such file to load -- pg) (RuntimeError) from /var/www/cmgmail/production/releases/20100810151610/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:inestablish_connection' etc. . . .

when I leave the original shebang #!/usr/bin/env ruby intact, no combination of commands work.

e.g. script/my_script -e production returns:

/var/www/cmgmail/production/releases/20100810151610/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in establish_connection': development database is not configured (ActiveRecord::AdapterNotSpecified) from /var/www/cmgmail/production/releases/20100810151610/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:inestablish_connection' ...etc

./my_script returns: ./my_script: No such file or directory (yet I verified the file is there)

is there something obvious I am missing?

I suppose I can make this into a rake task but this script runs fine in dev mode.

A: 

Don't forget to run chmod a+x my_script. By the way, try running script/my_script with the RAILS_ENV=production environment variable.

floatless