Ruby on Rails - Invalid encoding error - ruby-on-rails

SOLVED: Used rvm to install ruby 2.0.0 and rails 3. After using a newer version of ruby, this problem disappeared.
When I run $ rails server locally and try to load any of the static assets in the browser, eg "localhost:3000/assets/javascripts/main.js", I get the following error:
Internal Server Error
invalid encoding ("UTF-8//IGNORE", "BINARY")
WEBrick/1.3.1 (Ruby/1.8.7/2012-02-08) at localhost:3000
This happens on all static assets. What could be the problem here?
I'm using Mac OS X 10.7.5
Stack trace:
[2013-02-28 12:59:12] ERROR Iconv::InvalidEncoding: invalid encoding ("UTF-8//IGNORE", "BINARY")
/Library/Ruby/Gems/1.8/gems/i18n-0.6.3/lib/i18n/core_ext/string/encoding.rb:7:in `conv'
/Library/Ruby/Gems/1.8/gems/i18n-0.6.3/lib/i18n/core_ext/string/encoding.rb:7:in `force_encoding'
/Library/Ruby/Gems/1.8/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:41:in `escape_glob_chars'
/Library/Ruby/Gems/1.8/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:14:in `match?'
/Library/Ruby/Gems/1.8/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:56:in `call'
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59: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.4.5/lib/rack/handler/webrick.rb:13:in `run'
/Library/Ruby/Gems/1.8/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start'
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:55
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
/Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:50
script/rails:6:in `require'
script/rails:6

Related

Unexpected error while processing request: invalid byte sequence in UTF-8 #

when enable rack-mini-profiler gem, it gives error
Unexpected error while processing request: invalid byte sequence in UTF-8
using
Rails v4.0.6
rack-mini-profiler 0.10.1
Ruby 2.2.0
only happen if enable rake-mini-profiler, otherwise application working fine.
backtrace:
Unexpected error while processing request: invalid byte sequence in UTF-8
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/client_settings.rb:24:in `split'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/client_settings.rb:24:in `initialize'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:153:in `new'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:153:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/engine.rb:511:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/application.rb:97:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/content_length.rb:14:in `call'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:86:in `block in pre_process'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `catch'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:84:in `pre_process'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:53:in `process'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/connection.rb:39:in `receive_data'
/home/aa/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:193:in `run_machine'
/home/aa/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.8/lib/eventmachine.rb:193:in `run'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/backends/base.rb:73:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/thin-1.6.4/lib/thin/server.rb:162:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/handler/thin.rb:16:in `run'
/home/aa/.rvm/gems/ruby-2.2.0/gems/rack-1.5.5/lib/rack/server.rb:264:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands/server.rb:84:in `start'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands.rb:76:in `block in <top (required)>'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands.rb:71:in `tap'
/home/aa/.rvm/gems/ruby-2.2.0/gems/railties-4.0.6/lib/rails/commands.rb:71:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
I'm not sure, i think this error keep coming after 'Slim-Rails' gem
just added
gem "handle_invalid_percent_encoding_requests"
working fine !
solution from https://stackoverflow.com/a/24894410/3212137

uninitialized constant ActiveSupport::HashWithIndifferentAccess while sharing session between Rails 2 and Rails 4 Applications

I am getting the following issue while trying to share session between Rails 2 and Rails 4 Applications.
Status: 500 Internal Server Error
uninitialized constant ActiveSupport::HashWithIndifferentAccess
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:469:in `load_missing_constant'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:106:in `rake_original_const_missing'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rake-0.8.3/lib/rake.rb:2465:in `const_missing'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/message_verifier.rb:31:in `load'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.11/lib/active_support/message_verifier.rb:31:in `verify'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:171:in `unmarshal'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:159:in `unpacked_cookie_data'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:257:in `stale_session_check!'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:156:in `unpacked_cookie_data'
/home/dinesh/tracoffshore/offshore/lib/rails_4_session_flash_backport/rails2/session_with_indifferent_access.rb:43:in `load_session'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:132:in `send'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:132:in `load!'
/home/dinesh/tracoffshore/offshore/lib/rails_4_session_flash_backport/rails2/session_with_indifferent_access.rb:14:in `[]'
/home/dinesh/tracoffshore/offshore/vendor/plugins/authlogic-connect/lib/authlogic_connect/callback_filter.rb:14:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-openid-1.3.1/lib/rack/openid.rb:98:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/string_coercion.rb:25:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/head.rb:9:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/methodoverride.rb:24:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/params_parser.rb:15:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/session/cookie_store.rb:99:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/failsafe.rb:26:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/lock.rb:11:in `synchronize'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/lock.rb:11:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:114:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/reloader.rb:34:in `run'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/actionpack-2.3.11/lib/action_controller/dispatcher.rb:108:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rails-2.3.11/lib/rails/rack/static.rb:31:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/urlmap.rb:47:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/urlmap.rb:41:in `each'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/urlmap.rb:41:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rails-2.3.11/lib/rails/rack/log_tailer.rb:17:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/content_length.rb:13:in `call'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/handler/webrick.rb:48:in `service'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/share/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rack-1.1.6/lib/rack/handler/webrick.rb:14:in `run'
/home/dinesh/.rvm/gems/ruby-1.8.7-head/gems/rails-2.3.11/lib/commands/server.rb:111
script/server:4:in `require'
script/server:4
I am taking help from the following 3 links.
https://www.theguild.nl/share-sessions-between-rails-2-and-rails-3-applications
https://medium.com/ruby-on-rails/3-steps-to-share-a-session-between-rails-3-and-rails-4-applications-9618766e6c2a#.1q15dg9a4.
http://webuild.envato.com/blog/upgrading-ruby-on-rails-at-production-scale/
Still not able to add ActiveSupport::HashWithIndifferentAccess class to my rails 2 app.
I'd strongly suggest against taking this approach as it's likely to lead to a ton of headaches like the above.
ActiveSupport::HashWithIndifferentAccess is not available in Rails versions prior to 3. You can likely shoehorn HashWithIndifferentAccess into Rails 2, but honestly I think it would be much more worthwhile to upgrade the legacy system.
It's also rather difficult to give much insight without the code that produced the error.

Websocket Rails deadlocking issue

Having an issue in a Rails 4 app where I'm getting a deadlock error (details below). I'm using the 'websocket-rails' gem.
It seems to be happening on every 2nd request, coming from dispatcher = new WebSocketRails('localhost:3000/websocket'); (from the front-end of my app)
I've seen little to no mention of this issue except for an older issue within the faye repo on github: https://github.com/faye/faye/issues/190
Error:
Started GET "/websocket" for 127.0.0.1 at 2014-10-20 00:26:38 -0700
#<ActionDispatch::Request:0x007fae697e4a18>
Unexpected error while processing request: deadlock; recursive locking
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:16:in `lock'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:16:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/static.rb:64:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/engine.rb:514:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/application.rb:144:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/faye-websocket-0.7.5/lib/faye/adapters/thin.rb:40:in `process'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/faye-websocket-0.7.5/lib/faye/adapters/thin.rb:44:in `receive_data'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/server.rb:69:in `start'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:81:in `block in server'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `tap'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:76:in `server'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/railties-4.1.6/lib/rails/commands.rb:17:in `<top (required)>'
/Users/userme/Desktop/rdio-client-v2/server/bin/rails:8:in `require'
/Users/userme/Desktop/rdio-client-v2/server/bin/rails:8:in `<top (required)>'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/userme/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/userme/Desktop/rdio-client-v2/server/bin/spring:16:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Adding
config.middleware.delete Rack::Lock
to application.rb should help.

rails 2.3.5 failsafe error

I installed ruby 1.8.7 and rails 2.3.5 using rvm.I created my project and when i try to start the server using script/server i get this error
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-02-08 17:59:53] INFO WEBrick 1.3.1
[2012-02-08 17:59:53] INFO ruby 1.8.7 (2011-12-28) [i686-darwin11.0.0]
[2012-02-08 17:59:53] INFO WEBrick::HTTPServer#start: pid=14527 port=3000
/!\ FAILSAFE /!\ Wed Feb 08 18:00:03 +0530 2012
Status: 500 Internal Server Error
no such file to load -- sqlite3
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:7:in `require_library_or_gem'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in `sqlite3_connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/1.8/webrick/server.rb:82:in `start'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:in `run'
/Users/anandhegde/.rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/commands/server.rb:111
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Users/anandhegde/.rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
and when i open localhost:3000/trip in my browser it says
We're sorry, but something went wrong.
"We've been notified about this issue and we'll take a look at it shortly."
Does anybody know why this is happening?
Have u install sqlite3 gem and its package
The answer is in the line no such file to load -- sqlite3. You need to install the sqlite3 gem with: gem install sqlite3.
I have to ask though, why are you using such an old version of Rails? If you need to stick to 2.3 then you should at least go for version 2.3.11.

Strange behavior between rails and irb

If I drop in to irb and do require 'atom' I can successfully include the gem but if I try to include it in my controller in rails I get no such file to load -- atom when I visit the page in the browser. What's going on here?
Here's the complete stack trace:
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
D:/Build/Contactly/app/controllers/contacts_controller.rb:3
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in `load_file'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in `load_file'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in `require_or_load'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in `load_missing_constant'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in `constantize'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `constantize'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in `recognize'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in `_call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
irb is the interactive Ruby shell which is not rails. when you do gem install you are making it available for your installed version of Ruby, however Rails is slightly different. Rails only interacts with the gems you have listed in your Gemfile. Assuming you are using Rails 3, you would edit your Gemfile to include to the gem
gem 'atom'
save the file and then run
bundle install
then, once you run rails s that gem is available to your rails application. For future note, if you want to try out how something will work in a rails context, instead of invoking irb, invoke rails console or ./script/rails console (depending on which version of rails you are using).
Did you include it in your gemfile?

Resources