While running rake precompile:assets i''m getting the following error This is the error message: rake assets:precompile:all RAILS_ENV=production rake aborted! undefined local variable or method `establish_connection'' for ActiveRecord::Base:Class Please help -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c025224a-76eb-4d1b-82bd-2c0c4f556485%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, May 14, 2013 3:07:06 AM UTC-4, sith wrote:> > While running rake precompile:assets i''m getting the following error > > This is the error message: > rake assets:precompile:all RAILS_ENV=production > rake aborted! > undefined local variable or method `establish_connection'' for > ActiveRecord::Base:Class > > > Please help >not sure on this, it could be a number of things. establish_connection is a class method used by Active Record to establish a connection between your application and the database, using the information you provide in config/database.yml. By default, it''s called whenever rails is invoked, even though it really has nothing to do with precompiling assets. Usually, when it throws an error, there''s an error somewhere in the database.yml file, but this error almost looks like it''s missing the definition for the ActiveRecord class. It''s going to be hard to pinpoint this error without more information. What version of rails are you running and in your config/application.rb file do you have the line require ''rails/all'' ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1b073900-c589-4376-855e-503eb115351d%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On 14 May 2013 08:07, sith <sithu.1989-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> While running rake precompile:assets i''m getting the following error > > This is the error message: > rake assets:precompile:all RAILS_ENV=production > rake aborted! > undefined local variable or method `establish_connection'' for > ActiveRecord::Base:ClassDo you get the same error when you start the server or run rake db:migrate for example? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
I solved this by specifying the version of my gem ''newrelic_rpm'' .I still can''t figure out why I had to do so to solve my issue. On Tuesday, May 14, 2013 12:37:06 PM UTC+5:30, sith wrote:> > While running rake precompile:assets i''m getting the following error > > This is the error message: > rake assets:precompile:all RAILS_ENV=production > rake aborted! > undefined local variable or method `establish_connection'' for > ActiveRecord::Base:Class > > > Please help >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8dd9259b-5279-480c-8f5f-1fe718d2e809%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
sith wrote in post #1109140:> I solved this by specifying the version of my gem ''newrelic_rpm'' .I > still > can''t figure out why I had to do so to solve my issue.Thanks, this worked for me by giving this line in gemfile - ''gem ''newrelic_rpm'' , "3.5.4.33"'' -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bc2fe33a2070f8c7c677e8d87078dbf0%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
Maybe Matching Threads
- rake assets:precompile issue with JS and stylesheets files with similar name
- Heroku - Event_Calendar - preventing assets precompile
- Rails 3.1rc6 assets / precompile change
- server started as daemon: Application behaves differently from running in console
- My server reboots every hour! Help please!