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/
Related
I am doing some open source stuff for the rails app https://github.com/publiclab/mapknitter but when I try to launch the rails server using rails s I get the following error message:
DEPRECATION WARNING: Support for Rails versions before 4.2 is deprecated and will be removed from skylight 2.0. (called from require at /Users/bena/.rvm/rubies/ruby-2.4.6/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81)
=> Booting WEBrick
=> Rails 3.2.22.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[SKYLIGHT] [1.7.2] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
Exiting
/Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/application/configuration.rb:115:in `read': No such file or directory # rb_sysopen - /Users/bena/Documents/repos/ben-repos/mapknitter/config/database.yml (Errno::ENOENT)
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/application/configuration.rb:115:in `database_configuration'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activerecord-3.2.22.5/lib/active_record/railtie.rb:84:in `block (2 levels) in <class:Railtie>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activerecord-3.2.22.5/lib/active_record/base.rb:720:in `<top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config/initializers/column_definition.rb:19:in `<class:ColumnDefinition>'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config/initializers/column_definition.rb:17:in `<top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in `each'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/engine.rb:592:in `block in <class:Engine>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:30:in `run'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in `each'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/application.rb:136:in `initialize!'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config/environment.rb:5:in `<top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/skylight-1.7.2/lib/skylight/probes.rb:119:in `require'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config.ru:3:in `block in <main>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:51:in `instance_eval'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:51:in `initialize'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config.ru:in `new'
from /Users/bena/Documents/repos/ben-repos/mapknitter/config.ru:in `<main>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:40:in `eval'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/builder.rb:40:in `parse_file'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/server.rb:200:in `app'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands/server.rb:46:in `app'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/server.rb:304:in `wrapped_app'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/rack-1.4.7/lib/rack/server.rb:254:in `start'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands/server.rb:70:in `start'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands.rb:50:in `tap'
from /Users/bena/.rvm/gems/ruby-2.4.6/gems/railties-3.2.22.5/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Is the problem caused by the the version of rails I am using or the version of skylight or something else entirely?
I am using ruby 2.4.6p354 and rails 3.2.22.5
I have installed and tried to switch to rails 4.2.0 but that doesn't seem to be working, I think because in the gemfile there is a pessimistic version constraint of gem "rails" ,"~>3.2" but I could be completely wrong. I have been told not to change the gemfile.
Check first line in error backtrace. You dont have /config/database.yml in your project
No such file or directory # rb_sysopen -
/Users/bena/Documents/repos/ben-repos/mapknitter/config/database.yml
(Errno::ENOENT)
Make sure you install everything from Prerequisites and simply follow Installation guide
When I used rails s to initiate the Rails server I get this.
➜ zumin-share git:(master) rails s
rbenv: version `2.1.2' is not installed (set by /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/.ruby-version)
I then try to install rbenv 2.1.2 and the installer should be finished. I checked Rbenv version and I get.
rbenv version
2.1.2 (set by /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/.ruby-version)
I thought it was the .ruby-version file giving me trouble and when I removed it I get.
rails s
/usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/smart_listing-1.0.0/lib/smart_listing/config.rb:73: warning: duplicated key at line 79 ignored: :href
/usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ansi-1.4.3/lib/ansi/chart.rb:26: warning: duplicated key at line 29 ignored: :concealed
=> Booting Thin
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/configuration.rb:110:in `database_configuration': Cannot load `Rails.application.database_configuration`: (RuntimeError)
Could not load database configuration. No such file - ["config/database.yml"]
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:116:in `block in <class:Railtie>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config/environment.rb:5:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config.ru:3:in `block in <main>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config.ru:in `new'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config.ru:in `<main>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:61:in `app'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:78:in `start'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/bin/rails:8:in `require'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/bin/rails:8:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `call'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/command.rb:7:in `call'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client.rb:26:in `run'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/bin/spring:48:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
What am I doing wrong?
Your .ruby-version file is used by rbenv to detect what version of Ruby to use(besides looking in this file rbenv also looks in RBENV_VERSION environment variable if it's specified, and some other files). So in your case specified Ruby version was 2.1.2 and since it's not installed on your system rbenv complained about that, but since rbenv looks on few other places to detect what version of Ruby to use it found some other version and used it to run your code.
After installing version 2.1.2 your system now have version defined in your .ruby-version and rbenv will use it to run your code, but since your gems are installed for version of Ruby that you were using before 2.1.2 you'll get errors. At least I think that's what is going on, it would be great if some experienced programmer can comment on this.
I recently had to uninstall rvm and then reinstall rvm and reinstall rails --
It appears that rails didn't install correctly because I can't launch rails s. I'm working with ruby 2.3.0, and ran sudo gem install rails to get the latest version of rails.
After installing and running bundle install and bundle update, I got this error
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mkdir': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
Permission denied - ./.gem.20160330-64997-1erpjjg
Gem files will remain installed in /Users/chloe/.rvm/gems/ruby-2.3.0#global/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /Users/chloe/.rvm/gems/ruby-2.3.0#global/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.7.2/gem_make.out
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `block in mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:142:in `create'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mktmpdir'
from /Library/Ruby/Site/2.0.0/rubygems/ext/ext_conf_builder.rb:14:in `build'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in `chdir'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in `block in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `synchronize'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in `use_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /Users/chloe/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.6/bin/rails:9:in `<top (required)>'
from /usr/bin/rails:22:in `load'
from /usr/bin/rails:22:in `<main>'
I tried using the solution from this question, but got 'apt-get command not found' --- but I apologize if this requires a similar solution!
I'm using Mac OSX
EDIT ****
after updating gems with gem update ---system, I have a new error message:
=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/chloe/sites/bookshelf/config/environment.rb:7:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /Users/chloe/sites/bookshelf/config.ru:3:in `require'
from /Users/chloe/sites/bookshelf/config.ru:3:in `block in <main>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from /Users/chloe/sites/bookshelf/config.ru:in `new'
from /Users/chloe/sites/bookshelf/config.ru:in `<main>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:67:in `start'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/chloe/sites/bookshelf/bin/rails:9:in `require'
from /Users/chloe/sites/bookshelf/bin/rails:9:in `<top (required)>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/chloe/sites/bookshelf/bin/spring:13:in `require'
from /Users/chloe/sites/bookshelf/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
[1]: https://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror
****SOLUTION****
the solution from this question appeared to fix it:
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.
This appeared to solve the problem:
For the first issue--
run
gem update --system
For second issue --
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.
I have tried lot of different solutions from the web and i was unable to fix this issue.
This is the error I am getting when i perform a rails s
bash-3.2$ rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- openssl (LoadError)
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/session/cookie.rb:1:in `<top (required)>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/actionpack-3.2.11/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application/configuration.rb:140:in `const_get'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application/configuration.rb:140:in `session_store'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:273:in `block in default_middleware_stack'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:237:in `tap'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:237:in `default_middleware_stack'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/engine.rb:469:in `app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/sr027976/test_app/phappinfra_starter_app/config/environment.rb:5:in `<top (required)>'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:3:in `require'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:3:in `block in <main>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:51:in `instance_eval'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:51:in `initialize'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:in `new'
from /Users/sr027976/test_app/phappinfra_starter_app/config.ru:in `<main>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:40:in `eval'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/builder.rb:40:in `parse_file'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/server.rb:200:in `app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/server.rb:304:in `wrapped_app'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/rack-1.4.4/lib/rack/server.rb:254:in `start'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /Users/sr027976/.rvm/gems/ruby-1.9.3-p374#phappinfra_starter_app/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Assuming you have opensll installed properly - which you should check by reinstalling, sounds like an RVM related problem. Worst comes to worst I'd try reinstalling RVM (which is kind of a hassle)
Create a gemset using RVM
rvm gemset create gemset_name
Then run
bundle install
This is the actually problem of gem dependency.
These are the steps i performed and it worked for me.
rvm get head
rvm requirements
rvm pkg remove
brew install libksba autoconf automake
rvm reinstall 1.9.2 --with-openssl-dir=/usr/local
rvm pkg install readline --verify-downloads 1
rvm use 1.9.3 --default
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)