Being new to Rails, I'm trying to get a basic "hello world" app up and running. Specifically the app in chapter 2 of Agile Web Development with Rails. Loading up the hello world page results in the error given in the title.
So far I've done the following:
rails new demo
cd demo
Added gem 'therubyracer'
to the Gemfile
after ExecJS
complained about no JavaScript runtime being available.
bundle install
rake about # (see below)
rails generate controller Say hello goodbye
rails server
At this point WEBrick fires up and I load up http://localhost:3000/say/hello
. WEBrick logs the following error (which also appears in the browser):
Started GET "/say/hello" for 127.0.0.1 at 2012-10-26 11:45:10 -0400
Connecting to database specified by database.yml
Processing by SayController#hello as HTML
Rendered say/hello.html.erb within layouts/application (80.9ms)
Completed 500 Internal Server Error in 167ms
ActionView::Template::Error (uninitialized constant ExecJS::RubyRacerRuntime::Context::V8
(in /home/error/work/demo/app/assets/javascripts/say.js.coffee)):
3: <head>
4: <title>Demo</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
9: <body>
app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___1746644185114933585_70069037653480'
Rendered /home/error/.gem/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (3.7ms)
Rendered /home/error/.gem/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.2ms)
Rendered /home/error/.gem/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (18.7ms)
[2012-10-26 11:45:12] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
rake about
returns:
About your application's environment
Ruby version 1.9.3 (x86_64-linux)
RubyGems version 1.8.24
Rack version 1.4
Rails version 3.2.8
JavaScript Runtime therubyracer (V8)
Active Record version 3.2.8
Action Pack version 3.2.8
Active Resource version 3.2.8
Action Mailer version 3.2.8
Active Support version 3.2.8
Middleware ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x0000000276b298>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
Application root /home/error/work/demo
Environment development
Database adapter sqlite3
Database schema version 0
The workstation is running Fedora 17 x86_64. Despite that, I've pretty much ignored the ruby gems in the yum repositories (I think) and used gem install
in my home directory to get everything I need. (Again, I think.)
Being new to Ruby and Rails, I'm pretty sure I've missed some obvious convention that I'm not yet aware of. I'm also not quite sure what additional information I might need to provide, so please let me know that as well.