Re: Anyone having trouble using heroku console?

2011-07-14 Thread Keenan Brock
Thank you for all your help.

I added rake and re-created on the cedar stack.

Specifying thin broke my local passenger, so I added a production group

gem 'rake', '0.8.7'
gem 'thin', :group => :production

Thank again,
Keenan

On Jul 14, 2011, at 5:48 PM, Francois  wrote:

> Terence
> this error has been happening to a lot of people, it might be worth
> mentioning this in the docs somewhere? I searched for 'uninitialized
> constant Rake::DSL' in the docs and there was no mention.
>
> - F
>
> On Jul 14, 10:53 am, Terence Lee  wrote:
>> Hello Keenan,
>>
>> It's because rake is built into ruby 1.9.2 and the version is 0.8.7 and
>> that's the one being called here. We're looking into ways to fix this. In
>> the meantime, can you try hard coding your rake to 0.8.7 in your Gemfile?
>> Once you have that working locally, it should work fine on heroku.
>>
>> Best,
>> Terence
>>
>>
>>
>> On Wed, Jul 13, 2011 at 9:06 AM, Keenan Brock  wrote:
>>>  Hi,
>>
>>> Question: Are others able to run: heroku rake db:migrate OR heroku console
>>> "puts Model.count" ?
>>
>>> This is probably user error, but I can't figure it out. reminds me of not
>>> specifying RAILS_ENV when running rails console.
>>
>>> I had run rake db:seed which populated the Avatar model.
>>> I view a page on the website that relies upon the Avatar model.
>>> I ran heroku config:add RAILS_ENV=production (just in case)
>>
>>> But from heroku console:
>>
>>> *> puts Avatar.count*
>>> ActiveRecord::StatementInvalid: PGError: ERROR:  relation "avatars" does
>>> not exist
>>> : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
>>> d.adsrc, a.attnotnull
>>>   FROM pg_attribute a LEFT JOIN pg_attrdef d
>>> ON a.attrelid = d.adrelid AND a.attnum = d.adnum
>>>  WHERE a.attrelid = '"avatars"'::regclass
>>>AND a.attnum > 0 AND NOT a.attisdropped
>>>  ORDER BY a.attnum
>>
>>> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
>>> ection_adapters/abstract_adapter.rb:207:in
>>> `rescue in log'
>>> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
>>> ection_adapters/abstract_adapter.rb:199:in
>>> `log'
>>> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
>>> ection_adapters/postgresql_adapter.rb:501:in
>>> `query'
>>> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
>>> ection_adapters/postgresql_adapter.rb:1037:in
>>> `column_definitions'
>>
>>> *> heroku rake db:migrate*
>>
>>> (in /app)
>>> rake aborted!
>>> uninitialized constant Rake::DSL
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
>>> /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
>>> `'
>>> /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
>>> `'
>>> /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `>> (required)>'
>>> /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.8/lib/rdoc/task.rb:37:in `require'
>>> /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.8/lib/rdoc/task.rb:37:in `>> (required)>'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentat 
>>> ion.rake:2:in
>>> `require'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentat 
>>> ion.rake:2:in
>>> `'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in
>>> `load'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in
>>> `block in '
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
>>> `each'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
>>> `'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:2 
>>> 15:in
>>> `require'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:2 
>>> 15:in
>>> `initialize_tasks'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:1 
>>> 39:in
>>> `load_tasks'
>>> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:7 
>>> 7:in
>>> `method_missing'
>>> /app/Rakefile:7:in `'
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
>>> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
>>> /usr/ruby1.9.2/bin/rake:31:in `'
>>
>>> Thanks for any pointers on what I am doing wrong,
>>> Keenan
>>
>>> --Keenan
>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Heroku" group.
>>> To post to this group, send email to heroku@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> heroku+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.googl

Re: uninitialized constant Rake::DSL

2011-07-14 Thread Francois
I just noticed that Terrence just explained the reason why 1.9.2
doesn't work on heroku on another thread. Now it all makes sense :-)

>It's because rake is built into ruby 1.9.2 and the version is 0.8.7 and
>that's the one being called here. We're looking into ways to fix this. In
>the meantime, can you try hard coding your rake to 0.8.7 in your Gemfile?
>Once you have that working locally, it should work fine on heroku.
>Best,
>Terence

- F

On Jul 14, 1:46 pm, Francois  wrote:
> i'm not on the cedar stack so that isn't the issue. Rake is the issue,
> I just can't figure out why rake 1.9.2 works ok on my mac but not on
> heroku.
>
> Thanks
> - F
>
> On Jul 9, 6:56 am, Jesse House  wrote:
>
>
>
> > On the cedar stack i think you need 'run'
>
> >http://devcenter.heroku.com/articles/rails3#rake
>
> >  heroku run rake db:migrate
>
> > Similar to running
>
> > bundle exec rake db:migrate
>
> > On Jul 8, 4:02 pm, Francois  wrote:
>
> > > I have rake 0.9.2 on my local machine. When i type rake --version, I
> > > get:
> > > rake, version 0.9.2
>
> > > and my rails 3.0.9 app does not specify a version of rake in the
> > > Gemfile. When I do bundle list |grep rake
> > > I see:
> > >  * rake (0.9.2)
>
> > > Anyway, rake seems to work just fine on my local machine with a rails
> > > 3.0.9 app. However, when I push that app to heroku I run into the
> > > following error whenever I try to do heroku rake
> > > rake aborted!
> > > uninitialized constantRake::DSL
> > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> > > `'
>
> > > Anyone know why rake 0.9.2 fails on heroku but works just fine on my
> > > local machine?
>
> > > - Thanks
> > > Francois
>
> > > On Jun 21, 10:21 am, Alex Chaffee  wrote:
>
> > > > YMMV, but I'm pretty sure Rake 0.9.2 fixes this.
>
> > > > Another solution is to add the following to your Rakefile, right after
> > > > "require 'rake'"
>
> > > > class Rails::Application
> > > >   includeRake::DSL
> > > > end
>
> > > > (from memory; please let me know if it doesn't work and I'll look it
> > > > up for you)
>
> > > > On Jun 17, 7:01 pm, Daniel Myasnikov 
> > > > wrote:
>
> > > > > Hey
>
> > > > > I had the same issue, and the whole yesterday to solve it.
>
> > > > > First of all, if you are using Rake 0.8.7 and put "require 'rake/
> > > > > dsl_definition'" it won't work for you. This feature was introduced
> > > > > for Rake 0.9.x.
>
> > > > > I strongly recommend to use Rake 0.8.7
>
> > > > > and get rid out of everything that you put for rake 0.9.x, such as
> > > > > 'includeRake:dsl' and extend Rake::FileUtilsExt
>
> > > > > So your RakeFile file should look like:
>
> > > > > require File.expand_path('../config/application', __FILE__)
>
> > > > > require 'rake'
>
> > > > > MyApplicationName::Application.load_tasks
>
> > > > > 2. Secondly check if you have installed Rake 0.9.x and remove it from
> > > > > your computer and use Rake 0.8.7, which you have to install before
> > > > > using
>
> > > > > 3. Use gem "rake", "0.8.7" in your GemFile just after source 'http://
> > > > > rubygems.org'
>
> > > > > 4. Make sure your gem for rails is '3.0.9'
>
> > > > > 5. Some said that this gem also helped them gem 'sqlite3',
> > > > > '1.3.3', :group => :development
>
> > > > > Also don't forget about debugging your Heroku application using
> > > > > 'heroku logs'
>
> > > > > Daniel Myasnikov
>
> > > > > On Jun 18, 11:43 am, Karl  wrote:
>
> > > > > > Using Rails 3.0.9 (3.0.7 too), which load rake 0.9.2 with bamboo-
> > > > > > mri-1.9.2, causes:
>
> > > > > > $ heroku rake db:migrate
> > > > > > rake aborted!
> > > > > >uninitializedconstantRake::DSL
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> > > > > > `'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
> > > > > > `'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in
> > > > > > `'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.6.1/lib/rdoc/task.rb:37:in
> > > > > > `'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/
> > > > > > documentation.rake:2:in `'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:
> > > > > > 15:in `block in '
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:
> > > > > > 6:in `each'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:
> > > > > > 6:in `'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/
> > > > > > application.rb:215:in `initialize_tasks'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/
> > > > > > application.rb:139:in `load_tasks'
> > > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/
> > > > > > application.rb:77:in `method_missing'
> > > > > > /app/Rakefile:7:in `'
> > > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
> > > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rak

Re: Anyone having trouble using heroku console?

2011-07-14 Thread Francois
Terence
 this error has been happening to a lot of people, it might be worth
mentioning this in the docs somewhere? I searched for 'uninitialized
constant Rake::DSL' in the docs and there was no mention.

- F

On Jul 14, 10:53 am, Terence Lee  wrote:
> Hello Keenan,
>
> It's because rake is built into ruby 1.9.2 and the version is 0.8.7 and
> that's the one being called here. We're looking into ways to fix this. In
> the meantime, can you try hard coding your rake to 0.8.7 in your Gemfile?
> Once you have that working locally, it should work fine on heroku.
>
> Best,
> Terence
>
>
>
> On Wed, Jul 13, 2011 at 9:06 AM, Keenan Brock  wrote:
> >  Hi,
>
> > Question: Are others able to run: heroku rake db:migrate OR heroku console
> > "puts Model.count" ?
>
> > This is probably user error, but I can't figure it out. reminds me of not
> > specifying RAILS_ENV when running rails console.
>
> > I had run rake db:seed which populated the Avatar model.
> > I view a page on the website that relies upon the Avatar model.
> > I ran heroku config:add RAILS_ENV=production (just in case)
>
> > But from heroku console:
>
> > *> puts Avatar.count*
> > ActiveRecord::StatementInvalid: PGError: ERROR:  relation "avatars" does
> > not exist
> > :             SELECT a.attname, format_type(a.atttypid, a.atttypmod),
> > d.adsrc, a.attnotnull
> >               FROM pg_attribute a LEFT JOIN pg_attrdef d
> >                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
> >              WHERE a.attrelid = '"avatars"'::regclass
> >                AND a.attnum > 0 AND NOT a.attisdropped
> >              ORDER BY a.attnum
>
> > /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
> > ection_adapters/abstract_adapter.rb:207:in
> > `rescue in log'
> > /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
> > ection_adapters/abstract_adapter.rb:199:in
> > `log'
> > /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
> > ection_adapters/postgresql_adapter.rb:501:in
> > `query'
> > /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/conn 
> > ection_adapters/postgresql_adapter.rb:1037:in
> > `column_definitions'
>
> > *> heroku rake db:migrate*
>
> > (in /app)
> > rake aborted!
> > uninitialized constant Rake::DSL
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
> > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> > `'
> > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
> > `'
> > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in ` > (required)>'
> > /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.8/lib/rdoc/task.rb:37:in `require'
> > /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.8/lib/rdoc/task.rb:37:in ` > (required)>'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentat 
> > ion.rake:2:in
> > `require'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentat 
> > ion.rake:2:in
> > `'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in
> > `load'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in
> > `block in '
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
> > `each'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
> > `'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:2 
> > 15:in
> > `require'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:2 
> > 15:in
> > `initialize_tasks'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:1 
> > 39:in
> > `load_tasks'
> > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:7 
> > 7:in
> > `method_missing'
> > /app/Rakefile:7:in `'
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
> > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
> > /usr/ruby1.9.2/bin/rake:31:in `'
>
> > Thanks for any pointers on what I am doing wrong,
> > Keenan
>
> > --Keenan
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Heroku" group.
> > To post to this group, send email to heroku@googlegroups.com.
> > To unsubscribe from this group, send email to
> > heroku+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/heroku?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http:/

Re: uninitialized constant Rake::DSL

2011-07-14 Thread Francois
i'm not on the cedar stack so that isn't the issue. Rake is the issue,
I just can't figure out why rake 1.9.2 works ok on my mac but not on
heroku.

Thanks
- F

On Jul 9, 6:56 am, Jesse House  wrote:
> On the cedar stack i think you need 'run'
>
> http://devcenter.heroku.com/articles/rails3#rake
>
>  heroku run rake db:migrate
>
> Similar to running
>
> bundle exec rake db:migrate
>
> On Jul 8, 4:02 pm, Francois  wrote:
>
>
>
> > I have rake 0.9.2 on my local machine. When i type rake --version, I
> > get:
> > rake, version 0.9.2
>
> > and my rails 3.0.9 app does not specify a version of rake in the
> > Gemfile. When I do bundle list |grep rake
> > I see:
> >  * rake (0.9.2)
>
> > Anyway, rake seems to work just fine on my local machine with a rails
> > 3.0.9 app. However, when I push that app to heroku I run into the
> > following error whenever I try to do heroku rake
> > rake aborted!
> > uninitialized constantRake::DSL
> > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> > `'
>
> > Anyone know why rake 0.9.2 fails on heroku but works just fine on my
> > local machine?
>
> > - Thanks
> > Francois
>
> > On Jun 21, 10:21 am, Alex Chaffee  wrote:
>
> > > YMMV, but I'm pretty sure Rake 0.9.2 fixes this.
>
> > > Another solution is to add the following to your Rakefile, right after
> > > "require 'rake'"
>
> > > class Rails::Application
> > >   includeRake::DSL
> > > end
>
> > > (from memory; please let me know if it doesn't work and I'll look it
> > > up for you)
>
> > > On Jun 17, 7:01 pm, Daniel Myasnikov 
> > > wrote:
>
> > > > Hey
>
> > > > I had the same issue, and the whole yesterday to solve it.
>
> > > > First of all, if you are using Rake 0.8.7 and put "require 'rake/
> > > > dsl_definition'" it won't work for you. This feature was introduced
> > > > for Rake 0.9.x.
>
> > > > I strongly recommend to use Rake 0.8.7
>
> > > > and get rid out of everything that you put for rake 0.9.x, such as
> > > > 'includeRake:dsl' and extend Rake::FileUtilsExt
>
> > > > So your RakeFile file should look like:
>
> > > > require File.expand_path('../config/application', __FILE__)
>
> > > > require 'rake'
>
> > > > MyApplicationName::Application.load_tasks
>
> > > > 2. Secondly check if you have installed Rake 0.9.x and remove it from
> > > > your computer and use Rake 0.8.7, which you have to install before
> > > > using
>
> > > > 3. Use gem "rake", "0.8.7" in your GemFile just after source 'http://
> > > > rubygems.org'
>
> > > > 4. Make sure your gem for rails is '3.0.9'
>
> > > > 5. Some said that this gem also helped them gem 'sqlite3',
> > > > '1.3.3', :group => :development
>
> > > > Also don't forget about debugging your Heroku application using
> > > > 'heroku logs'
>
> > > > Daniel Myasnikov
>
> > > > On Jun 18, 11:43 am, Karl  wrote:
>
> > > > > Using Rails 3.0.9 (3.0.7 too), which load rake 0.9.2 with bamboo-
> > > > > mri-1.9.2, causes:
>
> > > > > $ heroku rake db:migrate
> > > > > rake aborted!
> > > > >uninitializedconstantRake::DSL
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> > > > > `'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
> > > > > `'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in
> > > > > `'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.6.1/lib/rdoc/task.rb:37:in
> > > > > `'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/
> > > > > documentation.rake:2:in `'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:
> > > > > 15:in `block in '
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:
> > > > > 6:in `each'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:
> > > > > 6:in `'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/
> > > > > application.rb:215:in `initialize_tasks'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/
> > > > > application.rb:139:in `load_tasks'
> > > > > /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/
> > > > > application.rb:77:in `method_missing'
> > > > > /app/Rakefile:7:in `'
> > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
> > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
> > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
> > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in
> > > > > `standard_exception_handling'
> > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
> > > > > /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
> > > > > /usr/ruby1.9.2/bin/rake:31:in `'
> > > > > (in /app)
>
> > > > > I had to add, before require 'rake':
>
> > > > > # Rakefile
> > > > > require 'rake/dsl_definition'
>
> > > > > But I don't get this on my development machine. Why?

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, s

Re: Anyone having trouble using heroku console?

2011-07-14 Thread Terence Lee
Hello Keenan,

It's because rake is built into ruby 1.9.2 and the version is 0.8.7 and
that's the one being called here. We're looking into ways to fix this. In
the meantime, can you try hard coding your rake to 0.8.7 in your Gemfile?
Once you have that working locally, it should work fine on heroku.

Best,
Terence

On Wed, Jul 13, 2011 at 9:06 AM, Keenan Brock  wrote:

>  Hi,
>
> Question: Are others able to run: heroku rake db:migrate OR heroku console
> "puts Model.count" ?
>
> This is probably user error, but I can't figure it out. reminds me of not
> specifying RAILS_ENV when running rails console.
>
> I had run rake db:seed which populated the Avatar model.
> I view a page on the website that relies upon the Avatar model.
> I ran heroku config:add RAILS_ENV=production (just in case)
>
> But from heroku console:
>
> *> puts Avatar.count*
> ActiveRecord::StatementInvalid: PGError: ERROR:  relation "avatars" does
> not exist
> : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
> d.adsrc, a.attnotnull
>   FROM pg_attribute a LEFT JOIN pg_attrdef d
> ON a.attrelid = d.adrelid AND a.attnum = d.adnum
>  WHERE a.attrelid = '"avatars"'::regclass
>AND a.attnum > 0 AND NOT a.attisdropped
>  ORDER BY a.attnum
>
> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:207:in
> `rescue in log'
> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:199:in
> `log'
> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:501:in
> `query'
> /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1037:in
> `column_definitions'
>
>
> *> heroku rake db:migrate*
>
> (in /app)
> rake aborted!
> uninitialized constant Rake::DSL
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
> /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in
> `'
> /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
> `'
> /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in ` (required)>'
> /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.8/lib/rdoc/task.rb:37:in `require'
> /app/.bundle/gems/ruby/1.9.1/gems/rdoc-3.8/lib/rdoc/task.rb:37:in ` (required)>'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentation.rake:2:in
> `require'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentation.rake:2:in
> `'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in
> `load'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in
> `block in '
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
> `each'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in
> `'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:in
> `require'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:in
> `initialize_tasks'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:139:in
> `load_tasks'
> /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:77:in
> `method_missing'
> /app/Rakefile:7:in `'
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
> /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
> /usr/ruby1.9.2/bin/rake:31:in `'
>
>
> Thanks for any pointers on what I am doing wrong,
> Keenan
>
> --Keenan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to heroku@googlegroups.com.
> To unsubscribe from this group, send email to
> heroku+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Cedar does not recognize RACK_ENV?

2011-07-14 Thread David Dollar
Do you see the same behavior if you run "RACK_ENV=staging rails console" 
locally?

On Jul 14, 2011, at 5:04 AM, arunthampi wrote:

> Hey guys - Tried running one of my apps on Cedar with RACK_ENV set to
> 'staging' but when I run `heroku run rails console` it says "Loading
> production environment". Also Rails.env returns "production". Anyone
> else seeing this? Is this a known bug?
> 
> Thanks!
> Arun
> 
> P.S. I checked and ENV['RACK_ENV'] is set to 'staging' but Rails.env
> returns 'production'
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to heroku@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Cedar does not recognize RACK_ENV?

2011-07-14 Thread arunthampi
Hey guys - Tried running one of my apps on Cedar with RACK_ENV set to
'staging' but when I run `heroku run rails console` it says "Loading
production environment". Also Rails.env returns "production". Anyone
else seeing this? Is this a known bug?

Thanks!
Arun

P.S. I checked and ENV['RACK_ENV'] is set to 'staging' but Rails.env
returns 'production'

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.