Re: Anyone having trouble using heroku console?

2011-09-24 Thread Alex Killough
I know this thread is two months old, but it is the only reference in
the official Heroku channels I have found referring to the dsl
conflict with the 1.9.2 stack and rake 0.9.x (I resorted to SO to find
a few more thorough explanations and possible solutions). If
documentation exists it would be great to know where for reference.

The conflict came about while fixing an issue with a crashed email
notification job. Turns out moving my stack from bamboo-ree(1.8.7) to
bamboo-mri(1.9.2) caused cron to throw 'uninitialized constant
Rake::DSL'.

Unfortunately this wasn't caught until we noticed nightly jobs had
stopped running.

Unfortunate as one of the jobs is a forum notification mass-mailer
that had a queue backed up for several days. ~2850 errant emails after
fixing the rake issue (5 minutes), our solution was to alter our Rake
file in the exact order below, adding require 'rake/dsl_definition'
_before_ require 'rake':

  require File.expand_path('../config/application', __FILE__)

  require 'rake/dsl_definition'
  require 'rake'

Beyond changes to the stack, I'd second updating  documentation for
cron, dj, workers, and proc/rake to include this potential conflict,
and methods to prevent the issue.

-Alex

On Thu, Jul 21, 2011 at 9:59 AM, Terence Lee tere...@heroku.com wrote:
 That's a good point. We'll take a look at adding something here.

 -Terence

 On Thu, Jul 14, 2011 at 4:48 PM, Francois fhar...@gmail.com 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 tere...@heroku.com 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 kee...@thebrocks.net
  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
   `class:TaskLib'
   /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in
   `module:Rake'
   /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in
   `top
   (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
   `top
   (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
   `top (required)'
  
   /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 top (required)'
  
   /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
   `top (required)'
  
   /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:2
   

Re: Error when using memcached uninitialized constant Memcached (NameError)

2010-12-13 Thread Alex Killough
Hi, I'm still having difficulty with memchaced, this time using dalli
as my client.
This is a rails 3 app.

in config/environments/production.rb:
  # Use a different cache store in production
  config.cache_store = :dalli_store
  config.perform_caching = true
  config.action_controller.perform_caching = true

in Gemfile:
  # cache backend
  gem 'memcached'
  gem 'dalli'

and the error message from heroku logs:
  /activesupport/lib/active_support/cache.rb:61:in `const_get':
uninitialized constant
  ActiveSupport::Cache::DalliStore (NameError)

Guessing I am missing an include or require directive somewhere, but
not sure where that would be from the dalli nor heroku docs. Any help
is much appreciated.

Many thanks,
Alex

On Wed, Nov 10, 2010 at 8:44 AM, joshmckin joshmc...@gmail.com wrote:
 Try Dalli. It works great and reduces your slug size 10 mb.

 https://github.com/mperham/dalli



 On Nov 10, 4:54 am, Alex Killough alexkillo...@gmail.com wrote:
 Hi, was there ever any resolution to this issue? I receive the same
 errors shown below when trying to use memcached-northscale (as Oren
 details) in my Rails 2.3.x and 3 projects.

 Thanks,
 Alex

 On Sep 11, 2010, at 4:16 AM, Henri Godron wrote:

  Hi Oren

  I tried the Gemfile with your suggestion:
  gem 'memcache'
  gem 'memcached-northscale', :require = 'memcached'

  Here is the error:
  == dyno-2143875.log (crash) ==
  /home/slugs/283964_c128375_5e65/mnt/.bundle/gems/ruby/1.8/gems/
  memcached-northscale-0.19.5.4/lib/memcached/memcached.rb:604:in
  `check_return_code': Key {} (Memcached::Failure)
          from /home/slugs/283964_c128375_5e65/mnt/.bundle/gems/ruby/
  1.8/gems/memcached-northscale-0.19.5.4/lib/memcached/memcached.rb:
  638:in `set_credentials'
          from /home/slugs/283964_c128375_5e65/mnt/.bundle/gems/ruby/
  1.8/gems/memcached-northscale-0.19.5.4/lib/memcached/memcached.rb:
  143:in `initialize'
          from /home/slugs/283964_c128375_5e65/mnt/.bundle/gems/ruby/
  1.8/gems/memcached-northscale-0.19.5.4/lib/memcached/rails.rb:29:in
  `initialize'

  I also tried to remove/add the addon to see if it was helping, but
  without success.

  On Sat, Sep 11, 2010 at 2:30 AM, Oren Teich o...@heroku.com wrote:
  I missed the last d.

  gem memcached-northscale, :require = memcached

  On Fri, Sep 10, 2010 at 3:38 PM, riton enjoy...@gmail.com wrote:
  hi Oren,

  Thanks for looking into my issue. Here are the modifications I made to
  my app , according to the heroku documentation and what you just said.

  Please, can you tell me what's wrong in that:

  environment.rb: no changes. I don't have to add the 'config gem' and
  'require' lines
  environment/production.rb: added  config.cache_store
  = :mem_cache_store, Memcached::Rails.new
  Gemfile: gem memcached-northscale, :require = memcache

  Is that correct ? If no, do i need gem 'memcache' in my Gemfile ? I
  tried with it, and with gem 'memcached' but without success.

  I ran bundle install in my local installation, my gemfile.lock is in
  GIT and this is fine with heroku's bundle (it runs whenever I add a
  gem in Gemfile).

  Here are the gem used with bundle

   Using rake (0.8.7)
        Using abstract (1.0.0)
        Using activesupport (3.0.0.rc2)
        Using builder (2.1.2)
        Using i18n (0.4.1)
        Using activemodel (3.0.0.rc2)
        Using erubis (2.6.6)
        Using rack (1.2.1)
        Using rack-mount (0.6.13)
        Using rack-test (0.5.4)
        Using tzinfo (0.3.23)
        Using actionpack (3.0.0.rc2)
        Using mime-types (1.16)
        Using polyglot (0.3.1)
        Using treetop (1.4.8)
        Using mail (2.2.5)
        Using actionmailer (3.0.0.rc2)
        Using arel (1.0.1)
        Using activerecord (3.0.0.rc2)
        Using activeresource (3.0.0.rc2)
        Using memcache (1.2.13)
        Using memcached-northscale (0.19.5.4)
        Using mysql (2.8.1)
        Using mysql2 (0.2.3)
        Using bundler (1.0.0)
        Using thor (0.14.0)
        Using railties (3.0.0.rc2)
        Using rails (3.0.0.rc2)

  And the error:
  /disk1/home/slugs/283964_74b4131_849c/mnt/config/environments/
  production.rb:33: uninitialized constant Memcached (NameError)

  Sorry, I don't know what to do .

  On Sep 10, 5:54 pm, Oren Teich o...@heroku.com wrote:
   if you're using a gemfile, you don't want to have any config.gem
  directives.
    It's one or the other.  Bundler replaces the way rails 2.3
  handles gems.http://gembundler.com/rails23.html

   http://gembundler.com/rails23.htmlif oyu're using bundler, it's

   gem memcached-northscale, :require = memcache

   Oren

   On Fri, Sep 10, 2010 at 4:15 AM, riton enjoy...@gmail.com wrote:
Hello,

I added the memcache 5MB free addon to my application.
I'm trying to make it work using the northscale gem as specified
  in
the documentation. I can't make it to work.

I can't get past this error  /production.rb:33: uninitialized
  constant
Memcached (NameError)

Here is my Gemfile

application fails to load after running 'bundle update'

2010-12-08 Thread Alex Killough
Hi, I've submitted this to support via a ticket, but am hoping someone
here may also have some insight:

I recently found my slug size expanded by a factor of two after I
moved some gems to a development group in an attempt to reduce slug
size. After following some advice I found on this list, I was able to
reduce my slug size to an acceptable level by adding rspec from my
development group, running 'bundle update' and pushing to heroku
master.

Following this, however, I am unable to launch my application; it
fails on initialization with the following message in the heroku logs:

undefined method `load_tasks' for Rails::Application:Class
/home/app/3fa53056-c556-4944-980b-b1e98b169afe/Rakefile:10

From reading up a bit it seems that this might be related to version
dependencies between rails stable and rack stable. I attempted to
update to using the edge version of rack, but this led to multiple
dependency errors in the rest of my application stack.

If anyone has insight or has experienced similar your help is greatly
appreciated; I'm at a loss as to where to go next.

Many thanks,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@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: application fails to load after running 'bundle update'

2010-12-08 Thread Alex Killough
I ended up reverting to a version of the Gemfile from before I created
the development and test groups, remade the groups, and was able to
fix the problem. I had installed edge rack as the initial message I
was getting is often indicated as a rack dependency mismatch with
rails 3, from what I have read. I removed rack from the gem file,
pointed auth_logic to the rails 3 branch, then remade the test and
development groups into a single block rather than two.

On Wed, Dec 8, 2010 at 8:14 AM, Alex Killough alexkillo...@gmail.com wrote:
 Hi, I've submitted this to support via a ticket, but am hoping someone
 here may also have some insight:

 I recently found my slug size expanded by a factor of two after I
 moved some gems to a development group in an attempt to reduce slug
 size. After following some advice I found on this list, I was able to
 reduce my slug size to an acceptable level by adding rspec from my
 development group, running 'bundle update' and pushing to heroku
 master.

 Following this, however, I am unable to launch my application; it
 fails on initialization with the following message in the heroku logs:

 undefined method `load_tasks' for Rails::Application:Class
 /home/app/3fa53056-c556-4944-980b-b1e98b169afe/Rakefile:10

 From reading up a bit it seems that this might be related to version
 dependencies between rails stable and rack stable. I attempted to
 update to using the edge version of rack, but this led to multiple
 dependency errors in the rest of my application stack.

 If anyone has insight or has experienced similar your help is greatly
 appreciated; I'm at a loss as to where to go next.

 Many thanks,
 Alex


-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to her...@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: Compiled Slug size not changing after removing large gems from Gemfile

2010-12-07 Thread Alex Killough
Any updates here? My slug doubled in size today when i removed gems;
now I can't launch my app.

On Tue, Oct 12, 2010 at 11:16 AM, stephen murdoch
stephenjamesmurd...@gmail.com wrote:
 yes Keenan, it's definitely my slug size that's creeping up (same
 problem others are having)

 I did some digging and this is what I found:

 According to the command-line output, my bundle is getting installed
 to `.bundle/gems`.

 I decided to try and vendor my gems to see if this would make a
 difference.

 Firstly, I downloaded the source for the compass gem and stuck in my
 vendor/gems directory.
 Then in Gemfile I pointed to the vendored version like so:

   gem 'compass', :path = File.join(File.dirname(__FILE__), '/vendor/
 gems/compass')

 I ran bundler again and pushed to heroku and watched the gem install
 and the slug increase in size.

 Then I removed the gem from my vendor directory, bundled and pushed to
 heroku again, and this time, the slug size decreased!

 So a possible fix for this problem might be to just vendor all gems
 until it's sorted out.

 Can't say that i've tested this out thoroughly but will give it a shot
 tonight when I have time just to be certain.

 On Oct 12, 7:52 am, Keenan Brock kee...@thebrocks.net wrote:
 Hi Stephen,

 If you checked in a gem into git
 Then you deleted the gem from git.
 Git still has the gem.
 It is not showing up for today, but git log will show when you added it and 
 removed it.

 Guess I do not know if you are checking in your bundle dir and gems into git.

 1. So are you saying your repo is 17mb, or your slug is 17mb?

 I'd imagine that the slug would be smaller on your change to the Gemfile.
 But you stating that your slug is big suggests that maybe the .git directory 
 is included in the slug?

 The slug size does affect the speed in which a dyno is started / compiles / 
 restarts.
 But I agree with Chris, I can't imagine it would slow it down too much.

 --Keenan
 On Oct 12, 2010, at 12:48 AM, Chris Hanks wrote:

  Yeah, this has happened to me before, too. I'm pretty sure the problem
  is on Heroku's end.

  I don't worry that much about it, though, since the max slug size is
  100 MB.

  On Oct 11, 8:57 pm, stephen murdoch stephenjamesmurd...@gmail.com
  wrote:
  I have encountered a few strange problems with Heroku this evening.

  My repo size somehow managed to bloat to 17mb so I removed some gems
  from my Gemfile (ran bundle install, git add Gemfile.lock etc etc) and
  found that my repo was still 17mb.

  I removed all my gems (apart from rails and pg) and the repo didn't
  get any smaller.  My app is no bigger than 2mb.

  So I deleted my app (along with my .git and .bundle directories) and
  created everything from scratch.

  This seemed to fix the problem, until just now, when I tried to remove
  4 large gems from my Gemfile and didn't see any change in the size of
  my compiled slug on Heroku.

  Is this something that other people are experiencing?

  FWIW, I've tried everything I can think of, including removing
  Gemfile.lock, .bundle etc etc

  --
  You received this message because you are subscribed to the Google Groups 
  Heroku group.
  To post to this group, send email to her...@googlegroups.com.
  To unsubscribe from this group, send email to 
  heroku+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://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 her...@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 her...@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.