unexpected indentation error with favicon_tag after migration to rails 5.0 - haml

With this HAML part
!!!
%html
%head
%title=document_title
= favicon_link_tag 'logo16.png'
%meta{content: form_authenticity_token, name: "csrf-token"}= ''
...
I get the error
SyntaxError: [stdin]:68:1: unexpected indentation
So I played a bit with wrong Identation; then I get other but correct errors
Inconsistent indentation: "\t\t " used for indentation, but the rest of the document was indented using 1 tab.
Inconsistent indentation: "\t " used for indentation, but the rest of the document was indented using 1 tab.
Illegal nesting: content can't be both given on the same line as %title and nested within it.
and stack trace looks like
app/views/layouts/page_print.html.haml:5
haml (4.0.7) lib/haml/parser.rb:174:in `block in tabs'
but with the unexpected Indentation I get an interesting stack - what does the coffee_script there?:
compile (C:\Users\halfbit\AppData\Local\Temp\execjs20161121-7752-txwa8bjs:6692:19)
eval (<anonymous>:1:10)
C:\Users\halfbit\AppData\Local\Temp\execjs20161121-7752-txwa8bjs:6703:8
C:\Users\halfbit\AppData\Local\Temp\execjs20161121-7752-txwa8bjs:6709:14
require./helpers.exports (C:\Users\halfbit\AppData\Local\Temp\execjs20161121-7752-txwa8bjs:1:102)
Object.<anonymous> (C:\Users\halfbit\AppData\Local\Temp\execjs20161121-7752-txwa8bjs:1:120)
Module._compile (module.js:409:26)
Object.Module._extensions..js (module.js:416:10)
Module.load (module.js:343:32)
Function.Module._load (module.js:300:12)
Function.Module.runMain (module.js:441:10)
startup (node.js:139:18)
node.js:968:3
execjs (2.7.0) lib/execjs/external_runtime.rb:39:in `exec'
execjs (2.7.0) lib/execjs/external_runtime.rb:21:in `eval'
execjs (2.7.0) lib/execjs/external_runtime.rb:46:in `call'
coffee-script (2.4.1) lib/coffee_script.rb:78:in `compile'
sprockets (3.7.0) lib/sprockets/coffee_script_processor.rb:21:in `block in call'
sprockets (3.7.0) lib/sprockets/cache.rb:85:in `fetch'
sprockets (3.7.0) lib/sprockets/coffee_script_processor.rb:20:in `call'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.0) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.0) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.0) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.0) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.0) lib/sprockets/bundle.rb:23:in `block in call'
sprockets (3.7.0) lib/sprockets/utils.rb:196:in `dfs'
sprockets (3.7.0) lib/sprockets/bundle.rb:24:in `call'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:75:in `call_processor'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:57:in `block in call_processors'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `reverse_each'
sprockets (3.7.0) lib/sprockets/processor_utils.rb:56:in `call_processors'
sprockets (3.7.0) lib/sprockets/loader.rb:134:in `load_from_unloaded'
sprockets (3.7.0) lib/sprockets/loader.rb:60:in `block in load'
sprockets (3.7.0) lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
sprockets (3.7.0) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.0) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.0) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.0) lib/sprockets/base.rb:73:in `find_all_linked_assets'
sprockets (3.7.0) lib/sprockets/manifest.rb:142:in `block in find'
sprockets (3.7.0) lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
sprockets (3.7.0) lib/sprockets/path_utils.rb:228:in `block in stat_tree'
sprockets (3.7.0) lib/sprockets/path_utils.rb:212:in `block in stat_directory'
sprockets (3.7.0) lib/sprockets/path_utils.rb:209:in `each'
sprockets (3.7.0) lib/sprockets/path_utils.rb:209:in `stat_directory'
sprockets (3.7.0) lib/sprockets/path_utils.rb:227:in `stat_tree'
sprockets (3.7.0) lib/sprockets/legacy.rb:105:in `each'
sprockets (3.7.0) lib/sprockets/legacy.rb:105:in `block in logical_paths'
sprockets (3.7.0) lib/sprockets/legacy.rb:104:in `each'
sprockets (3.7.0) lib/sprockets/legacy.rb:104:in `logical_paths'
sprockets (3.7.0) lib/sprockets/manifest.rb:140:in `find'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:50:in `each'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:50:in `map'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:50:in `precompiled_assets'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:35:in `asset_precompiled?'
sprockets-rails (3.2.0) lib/sprockets/railtie.rb:251:in `block (3 levels) in <class:Railtie>'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:359:in `precompiled?'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:363:in `raise_unless_precompiled_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:337:in `digest_path'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:325:in `asset_path'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:102:in `block in resolve_asset_path'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:242:in `block in resolve_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:241:in `each'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:241:in `detect'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:241:in `resolve_asset'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:101:in `resolve_asset_path'
sprockets-rails (3.2.0) lib/sprockets/rails/helper.rb:79:in `compute_asset_path'
actionview (5.0.0.1) lib/action_view/helpers/asset_url_helper.rb:144:in `asset_path'
actionview (5.0.0.1) lib/action_view/helpers/asset_url_helper.rb:311:in `image_path'
actionview (5.0.0.1) lib/action_view/helpers/asset_tag_helper.rb:176:in `favicon_link_tag'
app/views/layouts/page_print.html.haml:5:in `_app_views_layouts_page_print_html_haml___1809589845_126062940'
Commenting
#= favicon_link_tag 'logo16.png'
no error
any Ideas?

I did it, I again debugged Rails - I hate to do this.
The "solution" or better the explanations are:
1.) Sprockets behaves completely different in Rails 5.0 that in Rails 3.2
2.) Sprockets reads and caches the whole assets path with first touch (favicon in this case)
3.) As far as I can see Sprockets tries to (coffee-) compile manifest.js (?)
4.) Any compile error is catched (rescued) to late (I would say in HAML in this case)
5.) Its therefor extremely misleading to get a - coffeescript indentation error pointing to .HAML or .RB file
What did I do?
In Sprockes::path_utlis I changed/added a begin/rescue:
# Public: Stat all the files under a directory.
#
# dir - A String directory
#
# Returns an Enumerator of [path, stat].
def stat_directory(dir)
return to_enum(__method__, dir) unless block_given?
self.entries(dir).each do |entry|
path = File.join(dir, entry)
# puts path.to_s
begin
if stat = self.stat(path)
yield path, stat
end
rescue => e
puts "error #{e} in: "+path
end
end
the output I got:
error SyntaxError: [stdin]:68:1: unexpected indentation in: C:/rbstart/app/assets/javascripts/application.js
error Undefined variable: "$std_width". in: C:/rbstart/app/assets/stylesheets/application.css
Because of caching the error is not always to reproduce.

Related

undefined method insert_record for Array

I have a Model A which has many objects of Model B using a :has_many association. When I create a new object of model A, set its attributes, build associated objects and inspect the non-persisted objects, it works fine. However, as soon as I try to persist the objects using save or save!, I am getting the following back-trace.
NoMethodError: undefined method `insert_record' for #<Array:0x000000052541f8>
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:154:in `send'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/autosave_association.rb:306:in `block in save_collection_association'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/associations/association_collection.rb:431:in `block in method_missing'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `block in method_missing'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `each'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `method_missing'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/associations/association_collection.rb:431:in `method_missing'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/autosave_association.rb:297:in `save_collection_association'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/autosave_association.rb:163:in `block in add_autosave_association_callbacks'
from /usr/lib/ruby/gems/2.0.0/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:415:in `_run_create_callbacks'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/callbacks.rb:281:in `create'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/persistence.rb:246:in `create_or_update'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/callbacks.rb:277:in `block in create_or_update'
from /usr/lib/ruby/gems/2.0.0/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:418:in `_run_save_callbacks'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/callbacks.rb:277:in `create_or_update'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/persistence.rb:39:in `save'
... 2 levels...
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:240:in `block (2 levels) in save'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:207:in `transaction'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:240:in `block in save'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
from /usr/lib/ruby/gems/2.0.0/gems/activerecord-3.0.5/lib/active_record/transactions.rb:239:in `save'
from (irb):104
from /usr/lib/ruby/gems/2.0.0/gems/railties-3.0.5/lib/rails/commands/console.rb:44:in `start'
from /usr/lib/ruby/gems/2.0.0/gems/railties-3.0.5/lib/rails/commands/console.rb:8:in `start'
from /usr/lib/ruby/gems/2.0.0/gems/railties-3.0.5/lib/rails/commands.rb:23:in `<top (required)>'
from /home/amitav/WMS/trunk/script/rails:6:in `require'
from /home/amitav/WMS/trunk/script/rails:6:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
I am using ruby 2.0.0p195 with rails 3.0.5.
This could be an compatibilityproblem. Update your Rails to a newer version v3.2 >=
Also if you don't want to upgrade your Rails 3.0.x project, make sure you run in on the ruby version where you developed it, e.g. 1.9.2 or 1.9.3.
With rvm or rbenv that should't be a problem.

Scaffolding with bootstrap:themed is throwing application error

Used rails to generate new project.
Added twitter-bootstrap-rails to Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Use thin as webserver
gem 'thin'
# Mysql
gem 'mysql2'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem "less-rails"
gem 'uglifier', '>= 1.0.3'
end
# Twitter bootstrap baby
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
# json
gem 'json'
# jQuery is the win
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Devise for auth goodness
gem 'devise'
# Cancan for permission goodness
gem 'cancan'
# Fog allows for easy communication with clouds
gem 'fog'
group :development, :test do
# Cannot run as gem and use heroku
# See: http://stackoverflow.com/questions/6288910/heroku-deployment-gemfile-lock-problem
# gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'faker'
gem 'factory_girl_rails'
gem 'rspec-rails'
gem 'shoulda-matchers'
gem 'capybara'
gem 'launchy'
gem 'database_cleaner'
gem 'guard-rspec'
end
#
# group :production do
# gem 'pg'
# end
Did a bundle install, all went well.
Then I did
$ rails g bootstrap:install
Still all is good.
Next, did this:
$ rails g bootstrap:layout application fixed
still good.
Then I did this:
$ rails g bootstrap:themed Posts
and got this:
/Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
from (erb):9:in `template'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
/Volumes/dev/projects/jason/fuckthis $ rails g bootstrap:themed posts
/Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
from (erb):9:in `template'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
/Volumes/dev/projects/jason/fuckthis $ rails g bootstrap:themed posts -f
/Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant Post (NameError)
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:59:in `block in columns'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:69:in `rescue_block'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:58:in `columns'
from (erb):9:in `template'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /Users/jason/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/erb.rb:838:in `result'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `identical?'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:130:in `invoke_with_conflict_check'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:97:in `block in generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:96:in `generate_erb'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:92:in `generate_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/twitter-bootstrap-rails-2.1.6/lib/generators/bootstrap/themed/themed_generator.rb:19:in `copy_views'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /Users/jason/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have rolled back to twitter-bootstrap-rails 2.1.5 and 2.1.4 to no avail.
Please advise.
You need to create the Post scaffold first. From https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/README.md:
rails g scaffold Post title:string description:text
rake db:migrate
rails g bootstrap:themed Posts

Occasional but non-repeatable TypeError (can't dump hash with default proc):

I occasionally get this error in my production. I cant replicate it - not in dev and not in prod,. If the same req that caused this error is re-run then after a couple of tries it works. Why is this happening ?
The other prob is that Exception Logger is not capturing this Error either - maybe thats a clue but not sure. Any advise is welcome
TypeError (can't dump hash with default proc):
activesupport (3.2.2) lib/active_support/message_verifier.rb:53:in `dump'
activesupport (3.2.2) lib/active_support/message_verifier.rb:53:in `generate'
actionpack (3.2.2) lib/action_dispatch/middleware/cookies.rb:297:in `[]='
actionpack (3.2.2) lib/action_dispatch/middleware/session/cookie_store.rb:67:in `set_cookie'
rack (1.4.1) lib/rack/session/abstract/id.rb:330:in `commit_session'
rack (1.4.1) lib/rack/session/abstract/id.rb:206:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.2) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.2) lib/active_support/callbacks.rb:405:in `_run__462345741__call__579728663__callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.2) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
rack (1.4.1) lib/rack/sendfile.rb:102:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.2) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.2) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.2) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
rack-rewrite (1.2.1) lib/rack/rewrite.rb:20:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/static.rb:61:in `call'
rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
railties (3.2.2) lib/rails/engine.rb:479:in `call'
railties (3.2.2) lib/rails/application.rb:220:in `call'
railties (3.2.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
<internal:prelude>:10:in `synchronize'
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'
Well the problem was as follows
I was stuffing the errors into flash[:alert] like so
flash[:alert] = new_user.errors
I changed this to
flash[:alert] = new_user.errors.full_messages.join(",")
And the errors were resolved. Apparently the errors array could not be dumped and hence the error.

Dreamhost: Ruby (Rack) application could not be started

I have been working on this problem in last two days using [http://jackassofalltrades.org/2012/02/updating-to-a-newer-rails-on-dreamhost][1]/ instruction. I have looked at other ruby on rails and dreamhost issues and instructions, but they seemed out of date. e.g 2010 etc. Moreover, I do aware of heroku which is very easy to deploy but expensive to keep running for my small project. So here are my problems.
Ruby (Rack)application could not be started - a mixture of two Ruby versions: Ruby 1.8 and 1.9 - when visiting to my website via browser.
I am unsure whether the gemset rails_michaelcollins_com remains true when i exit the terminal because every time I log in, the arrow to the particular gemset have been missing from "rvm gemset list".
Rails console error message stating "Could not find a JavaScript runtime" despite that I have Execjs 1.3.1 according to "bundle show" in rails.michaelcollins.com folder.
Thank you kindly in advance
Error mesage: Ruby (Rack) application could not be started
Application root: /home/miccol2/rails.michaelcollins.com
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/setup.rb 10 in `exit'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/setup.rb 10
/usr/lib/ruby/1.8/rubygems/custom_require.rb 36 in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb 36 in `require'
/home/miccol2/rails.michaelcollins.com/config/boot.rb 6
/usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require'
/home/miccol2/rails.michaelcollins.com/config/application.rb 1
/usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require'
/home/miccol2/rails.michaelcollins.com/config/environment.rb 2
/usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in `require' config.ru 3
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in `initialize'
config.ru 1 in `new'
config.ru
[oslo]$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
[oslo]$ which ruby
/home/miccol2/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
[oslo]$ rails -v
Rails 3.2.3
[oslo]$ which rails
/home/miccol2/.rvm/gems/ruby-1.9.3-p194/bin/rails
[oslo]$ rvm -v
rvm 1.13.4 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
[oslo]$ rvm gemset list
gemsets for ruby-1.9.3-p194 (found in /home/miccol2/.rvm/gems/ruby-1.9.3-p194)
global
rails_michaelcollins_com
[oslo]$ rvm gemset use rails_michaelcollins_com
Using ruby-1.9.3-p194 with gemset rails_michaelcollins_com
[oslo]$ rvm gemset list
gemsets for ruby-1.9.3-p194 (found in /home/miccol2/.rvm/gems/ruby-1.9.3-p194)
global
=> rails_michaelcollins_com
[oslo]$
[oslo]$ rails console
/home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/execjs-1.3.1/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/execjs-1.3.1/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/execjs-1.3.1/lib/execjs.rb:4:in `<top (required)>'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `block in require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
from /home/miccol2/rails.michaelcollins.com/config/application.rb:7:in `<top (required)>'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/railties-3.2.3/lib/rails/commands.rb:39:in `require'
from /home/miccol2/.rvm/gems/ruby-1.9.3-p194#rails_michaelcollins_com/gems/railties-3.2.3/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
[oslo]$
[oslo]$ bundle show
Gems included by the bundle:
* actionmailer (3.2.3)
* actionpack (3.2.3)
* activemodel (3.2.3)
* activerecord (3.2.3)
* activeresource (3.2.3)
* activesupport (3.2.3)
* arel (3.0.2)
* builder (3.0.0)
* bundler (1.1.3)
* coffee-rails (3.2.2)
* coffee-script (2.2.0)
* coffee-script-source (1.3.1)
* erubis (2.7.0)
* execjs (1.3.1)
* hike (1.2.1)
* i18n (0.6.0)
* journey (1.0.3)
* jquery-rails (2.0.2)
* json (1.7.1)
* mail (2.4.4)
* mime-types (1.18)
* multi_json (1.3.4)
* mysql2 (0.3.11)
* polyglot (0.3.3)
* rack (1.4.1)
* rack-cache (1.2)
* rack-ssl (1.3.2)
* rack-test (0.6.1)
* rails (3.2.3)
* railties (3.2.3)
* rake (0.9.2.2)
* rdoc (3.12)
* sass (3.1.17)
* sass-rails (3.2.5)
* sprockets (2.1.3)
* thor (0.14.6)
* tilt (1.3.3)
* treetop (1.4.10)
* tzinfo (0.3.33)
* uglifier (1.2.4)
[oslo]$
It looks like execjs can't find it a runtime JS server.
See this for morre information:
https://github.com/sstephenson/execjs
Do you need that gem? If so, you'll need to install a runtime JS server. One widely used one is https://github.com/cowboyd/therubyracer .
To install that runtime JS server, add this line to your Gemfile:
gem "therubyracer", :require => 'v8'
You've bundled execjs but it can't find a Javascript runtime, like, say, node.js.
If you truly need execjs, then install node.js.
Also, be sure that your PATH environment variable includes the path to your Javascript runtime installation before starting up Rails.

Can't load 'firewatir' gem in rails 3

I want to run cucumber command in rails 3 controllers,but I add 'gem firewatir' to gemfile,
when I 'rails server', I got this error,and page shows "Internal Server Error".
[2011-03-24 14:32:05] INFO WEBrick 1.3.1
[2011-03-24 14:32:05] INFO ruby 1.8.7 (2009-06-12) [universal-darwin10.0]
[2011-03-24 14:32:05] INFO WEBrick::HTTPServer#start: pid=91734 port=3000
[2011-03-24 14:32:06] ERROR NoMethodError: undefined method `cache' for :active_support:Symbol
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.5/lib/active_support/cache/strategy/local_cache.rb:74:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.5/lib/action_dispatch/middleware/static.rb:30:in `call'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:168:in `call'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/rack/log_tailer.rb:14:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/content_length.rb:13:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/handler/webrick.rb:13:in `run'
/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/server.rb:213:in `start'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands/server.rb:65:in `start'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:30
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
/Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
If I don't add 'gem firewatir' to gemfile, rails server can run,but when run the cucumber command, I get this error:
no such file to load -- firewatir (LoadError)
Anyone ever met this issue,or who know how to fix it? Thanks
I think it is a known (and fixed) problem: Watir and Rails 3.0.X incompatible
I'm not sure that this is the same thing since the stacktrace doesn't include any lines from commonwatir/firewatir. It could be something different, but can't say for sure.