Ruby on Rails cannot "start server" because of "uninitialized constant SampleApp" - ruby-on-rails

I'm working on a application in Ruby on Rails, and I changed my version of Rails and Rake. rails server does not work anymore:
~/sample_app/config.ru:4:in `block in <main>': uninitialized constant SampleApp (NameError)
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/builder.rb:46:in `instance_eval'
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/builder.rb:46:in `initialize'
from /home/sara/Documents/M1/s8/web avancé/projet/sample_app/config.ru:1:in `new'
from /home/sara/Documents/M1/s8/web avancé/projet/sample_app/config.ru:1:in `<main>'
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/builder.rb:35:in `eval'
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/builder.rb:35:in `parse_file'
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/server.rb:162:in `app'
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/server.rb:253:in `wrapped_app'
from /var/lib/gems/1.9.1/gems/rack-1.2.8/lib/rack/server.rb:204:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands/server.rb:65:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:30:in `block in <top (required)>'
from /var/lib/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /var/lib/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Make sure you run bundle again to update to the newer versions of rails and rake.

Related

How to disable partial update in Rails 4?

I know partial update in rails is good, but for my latest project, I need to disable it temporarily. Is there any way for me to do this in Rails 4?
I have tried to put ActiveRecord::Base.partial_updates = false in my environment.rb like what being suggested here, but it returns me a bunch of errors:
UPDATE (ERROR MESSAGE)
C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.3/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `partia
iveRecord::Base:Class (NoMethodError)
from C:/Users/ryzal_000/Sites/dotforge/config/environment.rb:7:in `<top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from C:/Users/ryzal_000/Sites/dotforge/config.ru:3:in `block in <main>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from C:/Users/ryzal_000/Sites/dotforge/config.ru:in `new'
from C:/Users/ryzal_000/Sites/dotforge/config.ru:in `<main>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/server.rb:139:in `log_to_stdout'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/server.rb:78:in `start'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
From rails 4.1 partial_updates is removed you can check it here http://guides.rubyonrails.org/4_1_release_notes.html

local variable or method `config' for main:Object (NameError)

I'm following this post for integrating Omniauth Twitter + Devise http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ and I have encounter an issue that is blocking me to start my rails app.
/Users/javier/Desktop/definitive/config/environment.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Users/javier/Desktop/definitive/config.ru:3:in `block in <main>'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/javier/Desktop/definitive/config.ru:in `new'
from /Users/javier/Desktop/definitive/config.ru:in `<main>'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/server.rb:50:in `app'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/server.rb:67:in `start'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/javier/Desktop/definitive/bin/rails:8:in `require'
from /Users/javier/Desktop/definitive/bin/rails:8:in `<top (required)>'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Users/javier/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/javier/Desktop/definitive/bin/spring:16:in `require'
from /Users/javier/Desktop/definitive/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I guess the issue is in the line 8 of config/environment.rb but can not find with the right fix. Is it possible that environment.rb should be included in 'config/environments/'?
The article states that you should put some code in:
config/environments/[environment].rb
Where [environment].rb is meant to signify one of the following files:
config/environments/development.rb
config/environments/production.rb
config/environments/test.rb
You could also put the code in config/application.rb if you want the same settings across your different environments.
The lines of code shown start with config.*, and they should be placed inside the Rails.application.configure do block.
config/environment.rb in a typical Rails 4 application is just a require and Rails.application.initialize!, and should not need modification.
If you have config.xxx in environment.rb
delete it and add these into development.rb:
Rails.application.configure do
config.xxx
end
I have also faced such an error(
NameError: undefined local variable or method `server' for main:Object
from (irb):1
from C:/RailsInstaller/Ruby2.2.0/bin/irb:11:in `<main>'),
)
maybe its because I am a Newbie in ruby on rails. hence instead of starting the rails server from direct command line I tried it to start from inside of IRB hence I got that error.
when I came out of IRB and started the server again from CMD it started smoothly.

Error when trying to inherit from ActionView::Template::Handler in Rails 3.2.13

I tried upgrading from Rails 3.0.23 to 3.2.13 and now I have an error stopping the server from starting that looks like this:
/Users/hamiltonchapman/Projects/project-static/lib/markdown_handler.rb:3:in `<top (required)>': uninitialized constant ActionView::Template::Handler (NameError)
from /Users/hamiltonchapman/Projects/project-static/config/environment.rb:9:in `<top (required)>'
from /Users/hamiltonchapman/Projects/project-static/config.ru:5:in `require'
from /Users/hamiltonchapman/Projects/project-static/config.ru:5:in `block in <main>'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/hamiltonchapman/Projects/project-static/config.ru:in `new'
from /Users/hamiltonchapman/Projects/project-static/config.ru:in `<main>'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/hamiltonchapman/.rvm/gems/ruby-2.1.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:9:in `require'
from script/rails:9:in `<main>'
The code that is causing this looks like:
require 'kramdown'
class MarkdownHandler < ActionView::Template::Handler
def self.call(template)
new.render(template, nil)
end
def render(template, local_assigns)
%(Kramdown::Document.new(
ERB.new(#{template.source.inspect}).result(binding)
).to_html.html_safe)
end
end
ActionView::Template.register_template_handler :emd, MarkdownHandler
ActionView::Template.register_template_handler :md, MarkdownHandler
However, if I just remove the inheritance then the server starts fine and all of the markdown files render as expected.
Any ideas as to what's going wrong?

Rail server crash on RHEL 6

I'm first timer to Ruby on Rails, trying to set it up on RHEL 6. Since the package manager had very older version of Ruby. I compiled from source with Ruby 1.9.3 and installed rails using
$gem install rails
Created a new app using
$rails new /path/to/newapp
but now when I try to run
$rails server
it crashes with given log
=> Booting WEBrick
=> Rails 3.2.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- openssl (LoadError)
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/cookie.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.1/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application/configuration.rb:140:in `const_get'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application/configuration.rb:140:in `session_store'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:268:in `block in default_middleware_stack'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:232:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:232:in `default_middleware_stack'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:469:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/anurag/rubyapp/config/environment.rb:5:in `<top (required)>'
from /home/anurag/rubyapp/config.ru:4:in `require'
from /home/anurag/rubyapp/config.ru:4:in `block in <main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /home/anurag/rubyapp/config.ru:1:in `new'
from /home/anurag/rubyapp/config.ru:1:in `<main>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/server.rb:46:in `app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/server.rb:70:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I've tried to search about this error but did not find a working solution.
Apart from this I'd like to point me to some useful resource which explains best practices in Ruby on Rails.
-
I fixed the problem.
I went inside extracted source directory of Ruby then run these.
$cd /ext/openssl/
$ruby extconf.rb
$make
$make install
I hope other will get some help from this. :-)
Your ruby is not compiled with SSL support. Try using rvm:
https://rvm.io
https://rvm.io/packages/openssl/

Ruby on rails - Error running rails s command

I installed the Rails installer in my Win7 machine from http://railsinstaller.org/. I already had the Ruby 1.9.2-p290. After installing the ROR through the installer, I rain rails s to start the server and I get the following error. Could anybody help me understanding the reason of this error>?
C:\Sites\ridemo>rails s
=> Booting WEBrick
=> Rails 3.1.0.rc6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0.rc6/lib/sp
rockets/railtie.rb:21:in `block (2 levels) in <class:Railtie>': undefined method
`static_root=' for #<Sprockets::Environment:0x361d178> (NoMethodError)
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/sprockets-2.0.
0/lib/sprockets/environment.rb:55:in `initialize'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1
.0.rc6/lib/sprockets/railtie.rb:20:in `new'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1
.0.rc6/lib/sprockets/railtie.rb:20:in `block in <class:Railtie>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:25:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:25:in `run'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:50:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:49:in `each'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:49:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/application.rb:92:in `initialize!'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Sites/ridemo/config/environment.rb:5:in `<top (required)>'
from C:/Sites/ridemo/config.ru:4:in `require'
from C:/Sites/ridemo/config.ru:4:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:51:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:51:in `initialize'
from C:/Sites/ridemo/config.ru:1:in `new'
from C:/Sites/ridemo/config.ru:1:in `<main>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:40:in `eval'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:200:in `app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands/server.rb:46:in `app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:301:in `wrapped_app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:252:in `start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands/server.rb:70:in `start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:54:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:49:in `tap'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
RailsInstaller now supports Rails 3.1, but promise nothing about previous RC versions. Like #Fabio said, try to update to the latest Rails version (change it in your Gemfile). Also, if you already had a ruby version installed, be sure you are using the RailsInstaller one by checking your system environment path variable. The one and only path to Ruby should be :
C:\RailsInstaller\Ruby1.9.2\bin;
needed to run the following and It resolved the problem:-
gem install rails -v=3.1.0.rc8
From (https://github.com/sstephenson/sprockets/issues/172)

Resources