If you get this from your error log, there might be two things you might look into:
1. assets pipeline precompile
2. cache_store is not properly set up for the environment (like staging and production)
To precompile the asset pipeline, you need a Javascript runtime like node.js
Or you will see the error message when you run
rake assets:precompile Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
Write the code in /lib/global.rb
def hello; “world”; end
Autoload in /config/application.rb
config.autoload_paths += Dir["#{config.root}/lib/**.rb/"]
from http://gabeodess.heroku.com/posts/14
I found myself wanting to set an attr_accessor to handle passing a date to my model in a form_for tag with the f.datetime_select helper. So this is what I had:
Model:
attr_accessor :my_time
View:
<%= f.datetime_select :my_time %>
Unfortunately when I submit my form I get this:
1 error(s) on assignment of [...]
Add the following to your application.rb
class Application < Rails::Application config.sass.load_paths << “#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets” config.sass.load_paths << “#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/blueprint/stylesheets” end
When I try to move the Devise stuff into a module User::Devise and include it in class User, I got this warning ‘warning: toplevel constant Devise referenced by User::Devise’
Please see the code before and after for a solution.
Solution is to make User::Devise before you do the include for class User
from http://ar.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html :host - Defaults to “localhost”. :port - Defaults to 5432. :username - Defaults to nothing. :password - Defaults to nothing. :database - The name of the database. No default, must be provided. :schema_search_path - An optional schema search path for the connection given as a string of comma-separated schema names. This is backward-compatible with the :schema_order option. :encoding - An optional [...]
p = Person.new p.first_name = ‘Tian’ p.last_name = nil p.first_name? # => true p.last_name? # => false
from http://benwoodall.com/2011/06/rails-global-access-to-rake-dsl-methods-is-deprecated/
So apparently the newest version of Rake (0.9+) breaks rails. You will get the error: WARNING: Global access to Rake DSL methods is deprecated. Please Include … Rake::DSL into classes and modules which use the Rake DSL methods. The quick fix is to downgrade to Rake 0.8.7, but you can also add this little [...]
deploy a branch
set :branch, $1 if `git branch` =~ /\* (\S+)\s/m
deploy current commit
set :branch, $1 if `git rev-parse HEAD` =~ /(\S+)/
-
Articles
- October 2012
- May 2012
- April 2012
- March 2012
- February 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
-
Calendar
June 2013 M T W T F S S « Oct 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 -
Meta