New Rails App Fails loading assets - ruby-on-rails

I'm trying to get a brand new skeleton app running in rails 3.1.0.rc8. However, whenever any asset tag/helper is used in a view(such as image_tag, javascript_include_tag, etc.), I get a asset compile error. Here's a snippet of my logs/development.log when I make a direct request to /assets/rails.png.
Started GET "/assets/rails.png" for 192.168.0.12 at Mon Aug 29 16:16:21 -0600 2011
Error compiling asset rails.png:
ArgumentError: wrong number of arguments (2 for 1)
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `respond_to?'
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `dump'
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `write_entry'
activesupport (3.1.0.rc8) lib/active_support/core_ext/file/atomic.rb:20:in `atomic_write'
activesupport (3.1.0.rc8) lib/active_support/cache/file_store.rb:101:in `write_entry'
activesupport (3.1.0.rc8) lib/active_support/cache/strategy/local_cache.rb:140:in `write_entry'
activesupport (3.1.0.rc8) lib/active_support/cache.rb:364:in `write'
activesupport (3.1.0.rc8) lib/active_support/cache.rb:520:in `instrument'
activesupport (3.1.0.rc8) lib/active_support/cache.rb:362:in `write'
sprockets (2.0.0.beta.15) lib/sprockets/caching.rb:117:in `cache_set'
sprockets (2.0.0.beta.15) lib/sprockets/caching.rb:80:in `cache_set_hash'
sprockets (2.0.0.beta.15) lib/sprockets/caching.rb:51:in `cache_asset'
sprockets (2.0.0.beta.15) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.0.beta.15) lib/sprockets/trail.rb:102:in `find_asset_in_path'
sprockets (2.0.0.beta.15) lib/sprockets/base.rb:102:in `find_asset'
sprockets (2.0.0.beta.15) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.0.beta.15) lib/sprockets/server.rb:42:in `call'
rack-mount (0.8.2) lib/rack/mount/prefix.rb:26:in `call'
rack-mount (0.8.2) lib/rack/mount/route_set.rb:152:in `call'
rack-mount (0.8.2) lib/rack/mount/code_generation.rb:96:in `recognize'
rack-mount (0.8.2) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.8.2) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.2) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/routing/route_set.rb:531:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.2) lib/rack/etag.rb:23:in `call'
rack (1.3.2) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.2) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.2) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/cookies.rb:326:in `call'
activerecord (3.1.0.rc8) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.0.rc8) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/callbacks.rb:29:in `call'
activesupport (3.1.0.rc8) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.0.rc8) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.1.0.rc8) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.0.rc8) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.2) lib/rack/sendfile.rb:101:in `call'
I'm running ruby 1.8.7 and Passenger, if relevant. Anyone else running into this error?

Fixed this by upgrading from sprockets 2.0.0.beta.15 to 2.0.0:
gem install sprockets -v=2.0.0
Kudos to Ryan Bigg for the help.

I met the same problem when compiling assets via rake task:
$ bundle exec rake assets:precompile --trace
...
** Execute assets:precompile:primary
rake aborted!
wrong number of arguments (2 for 1)
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.2.0/lib/active_support/cache/file_store.rb:91:in `respond_to?'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.2.0/lib/active_support/cache/file_store.rb:91:in `dump'
...
after spending 4+ hours and tried many approaches, I found that it may be an issue of Ruby. ( from this link: https://github.com/resolve/refinerycms/issues/538 )
$ ruby -v
ruby 1.8.7 (2008-05-31 patchlevel 0)
Here the patchlevel 0 is the problem. since my ruby was compiled from the source code. (some reason I can't make it installed from package manager or via RVM).
Solution:
Download a new source file from http://ftp.ruby-lang.org/pub/ruby/1.8/, e.g. patch 358 ,
compile it:
unzip ruby-1.8.7-p358.zip -d /tmp && cd /tmp/ruby-1.8.7-p358 && ./configure && make && sudo make install
now ruby has a new version: patch 358
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-linux]
and everything works!

Related

Cannot load such file -- bcrypt_ext

I'm currently experiencing the failure of bcrypt's encryptor while using Devise for Rails 5.0.1. I never had this issue before with the earlier Rails 4.2. I can't register new users through Devise. I will post information with regards to my gemfile and server log.
Gemfile.rb
gem 'bcrypt', platforms: :ruby
# Devise
gem 'devise'
gem 'devise_security_extension'
gem 'redis'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
Server log
Started POST "/register" for 127.0.0.1 at 2017-01-12 13:50:05 -0500
Processing by Users::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"bH6n7iWLhPMECDzTVkMyTc9FXtvkGrq5+K4wFs1g8Bxbjq9ShaLJP5gn72SFQlHc01j2ao5JKcv57ClWAzwsmw==", "user"=>{"email"=>"craigcarl#codex.com", "username"=>"codex", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
Completed 500 Internal Server Error in 258ms (ActiveRecord: 0.0ms)
LoadError - cannot load such file -- bcrypt_ext:
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
bcrypt-3.1.11-x86 (mingw32) lib/bcrypt.rb:16:in `rescue in <top (required)>'
bcrypt-3.1.11-x86 (mingw32) lib/bcrypt.rb:12:in `<top (required)>'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
devise (4.2.0) lib/devise/encryptor.rb:1:in `<top (required)>'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `block in require'
activesupport (5.0.1) lib/active_support/dependencies.rb:259:in `load_dependency'
activesupport (5.0.1) lib/active_support/dependencies.rb:293:in `require'
devise (4.2.0) lib/devise/models/database_authenticatable.rb:147:in `password_digest'
devise (4.2.0) lib/devise/models/database_authenticatable.rb:40:in `password='
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:46:in `public_send'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:46:in `_assign_attribute'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:40:in `block in _assign_attributes'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:39:in `each'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:39:in `_assign_attributes'
activerecord (5.0.1) lib/active_record/attribute_assignment.rb:26:in `_assign_attributes'
activemodel (5.0.1) lib/active_model/attribute_assignment.rb:33:in `assign_attributes'
activerecord (5.0.1) lib/active_record/core.rb:319:in `initialize'
activerecord (5.0.1) lib/active_record/inheritance.rb:65:in `new'
activerecord (5.0.1) lib/active_record/inheritance.rb:65:in `new'
devise (4.2.0) lib/devise/models/registerable.rb:20:in `new_with_session'
devise (4.2.0) app/controllers/devise/registrations_controller.rb:100:in `build_resource'
devise (4.2.0) app/controllers/devise/registrations_controller.rb:15:in `create'
actionpack (5.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.0.1) lib/abstract_controller/base.rb:188:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.0.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.0.1) lib/active_support/callbacks.rb:126:in `call'
activesupport (5.0.1) lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
activesupport (5.0.1) lib/active_support/callbacks.rb:455:in `call'
activesupport (5.0.1) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.0.1) lib/active_support/notifications.rb:164:in `block in instrument'
activesupport (5.0.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.0.1) lib/active_support/notifications.rb:164:in `instrument'
actionpack (5.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.0.1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
activerecord (5.0.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (5.0.1) lib/abstract_controller/base.rb:126:in `process'
actionview (5.0.1) lib/action_view/rendering.rb:30:in `process'
actionpack (5.0.1) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (5.0.1) lib/action_controller/metal.rb:262:in `dispatch'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (5.0.1) lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
actionpack (5.0.1) lib/action_dispatch/routing/mapper.rb:46:in `serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:725:in `call'
rack (2.0.1) lib/rack/deflater.rb:35:in `call'
warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
warden (1.2.6) lib/warden/manager.rb:34:in `catch'
warden (1.2.6) lib/warden/manager.rb:34:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:38:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.1) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.1) lib/rails/engine.rb:522:in `call'
puma (3.6.2) lib/puma/configuration.rb:225:in `call'
puma (3.6.2) lib/puma/server.rb:578:in `handle_request'
puma (3.6.2) lib/puma/server.rb:415:in `process_client'
puma (3.6.2) lib/puma/server.rb:275:in `block in run'
puma (3.6.2) lib/puma/thread_pool.rb:116:in `block in spawn_thread'
Started POST "/__better_errors/4e4442c3f810d7b9/variables" for 127.0.0.1 at 2017-01-12 13:50:06 -0500
I had a similar problem today with ruby 2.3.3 and rails 4.2.4.
The problem was that bundle install of devise installed as a dependency another version of bcrypt (bcrypt (3.1.11 x86-mingw32) instead of bcrypt (3.1.11)) which was causing trouble with ruby 2.3 (it should work with all previous versions of ruby)
The solution I used is to install bcrypt outside of the gemfile, run bundle and then remove the second version of bcrypt :
$ gem list bcrypt
bcrypt (3.1.11 x86-mingw32)
$ gem uninstall devise && gem uninstall bcrypt
Successfully uninstalled devise-4.2.0
Successfully uninstalled bcrypt-3.1.11-x86-mingw32
$ gem install bcrypt --platform=Ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed bcrypt-3.1.11
Parsing documentation for bcrypt-3.1.11
Installing ri documentation for bcrypt-3.1.11
Done installing documentation for bcrypt after 1 seconds
1 gem installed
$ gem list bcrypt
bcrypt (3.1.11)
$ bundle install
...
Installing bcrypt 3.1.11 (x86-mingw32)
...
Installing devise 4.2.0
Bundle complete! 25 Gemfile dependencies, 75 gems now installed.
$ gem list bcrypt
bcrypt (3.1.11 ruby x86-mingw32)
$ gem uninstall bcrypt
Select gem to uninstall:
1. bcrypt-3.1.11
2. bcrypt-3.1.11-x86-mingw32
3. All versions
> 2
Successfully uninstalled bcrypt-3.1.11-x86-mingw32
$ gem list bcrypt
bcrypt (3.1.11)
Hope that helps if you haven't solved your problem yet.
I also encountered the same problem, then I found some references and it's about version only.
When I changed bcrypt back to
bcrypt 3.1.0-x86-mingw32
from
bcrypt 3.1.11-x86-mingw32(the latest now)
Then make sure again in gemfile
gem 'bcrypt-ruby', '3.1.0', :require => 'bcrypt'
then it works fine.
I also face this same issue for ruby '2.3.3' and rails '5.2.0' but the only solution right now is to run:
gem uninstall bcrypt
gem install bcrypt --platform=ruby
temporary fix.
Maybe it's just the native binary is wrongly built or corrupted. Try below
Open a command console
cd to the gem directory C:\RailsInstaller\Ruby2.2.0\lib\ruby\gems\2.2.0\gems\bcrypt-3.1.10-x86-mingw32\ext\mri
Run ruby extconf.rb. It should create the Makefile
Run make. It will builde the extension libraries.
Run make install
See more at Fix issue "cannot load such file -- bcrypt_ext (LoadError)"
These steps to fix issue in MS Win 10 and 8
Uninstall all bcrypt
gem uninstall bcrypt
Go on lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/ and copy bcrypt_ext.so file. and paste on desktop for now.
Uninstall all bcrypt again
gem uninstall bcrypt
Add in your project's gemfile
gem 'bcrypt', '~> 3.1.7'
Run commands
bundle install
bundle update
Paste copied bcrypt_ext.so in folder lib/ruby/gems/2.3.0/gems/bcrypt-3.1.11-x86-mingw32/lib/ from desktop.
Restart server
rails server
It works on win 7 and 10!!!

Rails + JRuby: I'm getting a JDBC error while rendering the default app

I'm trying to make Rails work under a JRuby environment. I got everything working; no installation errors.
I installed Rails using jruby -S gem install rails, then I created a test app using both jruby -S rails new webtest and rails -S new webtest (second attempt). Both commands deploy the complete app directory with no errors.
Now, I haven't changed anything at all and I'm now just trying to see if the defaults work before I try anything else, so I cd webtest and run jruby -S rails server -b x.xx.xx.xx (second attempt: rails server -b x.xx.xx.xx) where the x's represent the server ip address in the internal network. The service is started and outputs the app URL, PID etc. I'm binding to the ip address because I need to access the app from another machine since the server itself is console only (if I leave the default bind [i.e. localhost], the app is unreachable for some reason).
But when I try to open the app (accessing from another machine) using http://x.xx.xx.xx:3000 I get the a Rails exception page with the header ActiveRecord::JDBCError and the following stacktrace. I tried to figure out what's wrong but, as you can see, the trace doesn't show any specific error message besides the trace.
Any help or insight is greatly appreciated.
>jruby -S rails server -b x.xx.xx.xx
NOTE: ActiveRecord 4.2 is not (yet) fully supported by AR-JDBC, please help us finish 4.2 support - check http://bit.ly/jruby-42 for starters
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://x.xx.xx.xx:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-02-27 14:28:00] INFO WEBrick 1.3.1
[2015-02-27 14:28:00] INFO ruby 1.9.3 (2013-12-06) [java]
[2015-02-27 14:28:00] INFO WEBrick::HTTPServer#start: pid=25886932 port=3000
Then while trying to access the app URL from another machine:
arjdbc/jdbc/RubyJdbcConnection.java:453:in `init_connection'
activerecord-jdbc-adapter (1.3.14) lib/arjdbc/jdbc/connection.rb:15:in `initialize'
activerecord-jdbc-adapter (1.3.14) lib/arjdbc/jdbc/adapter.rb:68:in `initialize'
activerecord-jdbc-adapter (1.3.14) lib/arjdbc/jdbc/connection_methods.rb:12:in `jdbc_connection'
activerecord-jdbc-adapter (1.3.14) lib/arjdbc/sqlite3/connection_methods.rb:24:in `sqlite3_connection'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `checkout'
/home/srpec/jruby-1.7.9/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `connection'
/home/srpec/jruby-1.7.9/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
activerecord (4.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
activerecord (4.2.0) lib/active_record/connection_handling.rb:113:in `retrieve_connection'
activerecord (4.2.0) lib/active_record/connection_handling.rb:87:in `connection'
activerecord (4.2.0) lib/active_record/migration.rb:384:in `connection'
activerecord (4.2.0) lib/active_record/migration.rb:371:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:29:in `call'
org/jruby/RubyProc.java:271:in `call'
activesupport (4.2.0) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:738:in `_run_call_callbacks'
activesupport (4.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.0) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.0) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
actionpack (4.2.0) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
railties (4.2.0) lib/rails/engine.rb:518:in `call'
railties (4.2.0) lib/rails/application.rb:164:in `call'
rack (1.6.0) lib/rack/lock.rb:17:in `call'
rack (1.6.0) lib/rack/content_length.rb:15:in `call'
rack (1.6.0) lib/rack/handler/webrick.rb:89:in `service'
/home/srpec/jruby-1.7.9/lib/ruby/1.9/webrick/httpserver.rb:138:in `service'
/home/srpec/jruby-1.7.9/lib/ruby/1.9/webrick/httpserver.rb:94:in `run'
/home/srpec/jruby-1.7.9/lib/ruby/1.9/webrick/server.rb:191:in `start_thread'
Environment information:
>rails -v
Rails 4.2.0
>jruby -v
jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on IBM J9 VM pap3270_27sr2-20141101_01 (SR2) [AIX-ppc]
>jgem list --local
*** LOCAL GEMS ***
actionmailer (4.2.0)
actionpack (4.2.0)
actionview (4.2.0)
activejob (4.2.0)
activemodel (4.2.0)
activerecord (4.2.0)
activerecord-jdbc-adapter (1.3.14)
activerecord-jdbcsqlite3-adapter (1.3.14)
activesupport (4.2.0)
arel (6.0.0)
builder (3.2.2)
bundler (1.8.3)
coffee-rails (4.1.0)
coffee-script (2.3.0)
coffee-script-source (1.9.1)
erubis (2.7.0)
execjs (2.3.0)
globalid (0.3.3)
hike (1.2.3)
i18n (0.7.0)
jbuilder (2.2.8)
jdbc-sqlite3 (3.8.7)
jquery-rails (4.0.3)
json (1.8.2 java)
loofah (2.0.1)
mail (2.6.3)
mime-types (2.4.3)
minitest (5.5.1)
multi_json (1.10.1)
nokogiri (1.6.6.2 java)
rack (1.6.0)
rack-test (0.6.3)
rails (4.2.0)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.5)
rails-html-sanitizer (1.0.1)
railties (4.2.0)
rake (10.4.2)
rdoc (4.2.0)
sass (3.4.13)
sass-rails (5.0.1)
sdoc (0.4.1)
sprockets (2.12.3)
sprockets-rails (2.2.4)
therubyrhino (2.0.4)
therubyrhino_jar (1.7.4)
thor (0.19.1)
thread_safe (0.3.4 java)
tilt (1.4.1)
turbolinks (2.5.3)
tzinfo (1.2.2)
tzinfo-data (1.2015.1)
uglifier (2.7.0)

Installed gem but getting cannot load such file

I have done the following
gem install crack
And added
gem 'crack'
To my gemfile.
I am then requiring require 'crack'
The error I get when I try and load the route is
cannot load such file -- crack
I have run gem environment and get the following
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.2
- RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin12.0]
- INSTALLATION DIRECTORY: /Users/joshuahornby/.rvm/gems/ruby-2.1.0
- RUBY EXECUTABLE: /Users/joshuahornby/.rvm/rubies/ruby-2.1.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/joshuahornby/.rvm/gems/ruby-2.1.0/bin
- SPEC CACHE DIRECTORY: /Users/joshuahornby/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0/bin
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0#global/bin
- /Users/joshuahornby/.rvm/rubies/ruby-2.1.0/bin
- /Users/joshuahornby/.rvm/bin
- /Applications/MAMP/bin/php/php5.5.3/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/bin
Error trace
activesupport (4.0.3) lib/active_support/dependencies.rb:229:in `require'
activesupport (4.0.3) lib/active_support/dependencies.rb:229:in `block in require'
activesupport (4.0.3) lib/active_support/dependencies.rb:212:in `block in load_dependency'
activesupport (4.0.3) lib/active_support/dependencies.rb:616:in `new_constants_in'
activesupport (4.0.3) lib/active_support/dependencies.rb:212:in `load_dependency'
activesupport (4.0.3) lib/active_support/dependencies.rb:229:in `require'
app/controllers/currencies_controller.rb:3:in `<class:CurrenciesController>'
app/controllers/currencies_controller.rb:1:in `<top (required)>'
activesupport (4.0.3) lib/active_support/dependencies.rb:424:in `load'
activesupport (4.0.3) lib/active_support/dependencies.rb:424:in `block in load_file'
activesupport (4.0.3) lib/active_support/dependencies.rb:616:in `new_constants_in'
activesupport (4.0.3) lib/active_support/dependencies.rb:423:in `load_file'
activesupport (4.0.3) lib/active_support/dependencies.rb:324:in `require_or_load'
activesupport (4.0.3) lib/active_support/dependencies.rb:463:in `load_missing_constant'
activesupport (4.0.3) lib/active_support/dependencies.rb:184:in `const_missing'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:226:in `const_get'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:226:in `block in constantize'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:224:in `each'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:224:in `inject'
activesupport (4.0.3) lib/active_support/inflector/methods.rb:224:in `constantize'
activesupport (4.0.3) lib/active_support/dependencies.rb:535:in `get'
activesupport (4.0.3) lib/active_support/dependencies.rb:566:in `constantize'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:76:in `controller_reference'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:66:in `controller'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:44:in `call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.3) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.3) lib/action_dispatch/routing/route_set.rb:680:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
activerecord (4.0.3) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.3) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.3) lib/active_support/callbacks.rb:373:in `_run__3271670212178920711__call__callbacks'
activesupport (4.0.3) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.3) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.3) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.3) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.3) lib/rails/engine.rb:511:in `call'
railties (4.0.3) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/joshuahornby/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/joshuahornby/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/joshuahornby/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
This error occurred while loading the following files:
crack
I am guessing it something to do with my ruby version?
Your Gem Path is referring to Ruby 2.1.0
- GEM PATHS:
- /Users/joshuahornby/.rvm/gems/ruby-2.1.0
whereas crack gem is installed for Ruby 2.0.0-p353
/Users/joshuahornby/.rvm/gems/ruby-2.0.0-p353/gems/crack-0.4.2
This is the problem. I simulated the same installation like yours and my GEM_PATH matches to the crack gem path.
Here is what I recommend. First uninstall the gem crack.
In your application path run rvm use 2.1.0 and then do bundle install.

ruby on rails new project gemfile error

I recently installed and created a new project, I followed rails tutorial (http://guides.rubyonrails.org/getting_started.html) and everything was ok.
Now, when I tried to create a new project and start the server I get this:
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-09-09 15:28:55] INFO WEBrick 1.3.1
[2013-09-09 15:28:55] INFO ruby 2.0.0 (2013-06-27) [x64-mingw32]
[2013-09-09 15:28:55] INFO WEBrick::HTTPServer#start: pid=12064 port=3000
Started GET "/" for 127.0.0.1 at 2013-09-09 15:28:56 +0100
Gem::LoadError (Specified 'sqlite3' for database adapter, but the gem is not loa
ded. Add `gem 'sqlite3'` to your Gemfile.):
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:58:in `rescue in resolve_hash_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:55:in `resolve_hash_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:46:in `resolve_string_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/connection_specific
ation.rb:30:in `spec'
activerecord (4.0.0) lib/active_record/connection_handling.rb:39:in `establish
_connection'
activerecord (4.0.0) lib/active_record/railtie.rb:175:in `block (2 levels) in
<class:Railtie>'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:38:in `instance_ev
al'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:38:in `execute_hoo
k'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:45:in `block in ru
n_load_hooks'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:44:in `each'
activesupport (4.0.0) lib/active_support/lazy_load_hooks.rb:44:in `run_load_ho
oks'
activerecord (4.0.0) lib/active_record/base.rb:322:in `<module:ActiveRecord>'
activerecord (4.0.0) lib/active_record/base.rb:22:in `<top (required)>'
activerecord (4.0.0) lib/active_record/query_cache.rb:50:in `restore_query_cac
he_settings'
activerecord (4.0.0) lib/active_record/query_cache.rb:43:in `rescue in call'
activerecord (4.0.0) lib/active_record/query_cache.rb:32:in `call'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection
_pool.rb:626:in `call'
activerecord (4.0.0) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in
call'
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__342058401_
_call__callbacks'
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `c
all'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `ca
ll'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tag
ged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `
call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/_source.erb (2.0ms)
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/_trace.erb (2.0ms)
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/_request_and_response.erb (2.0ms)
Rendered C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_d
ispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (122.
1ms)
When I open a browser window I get
Gem::LoadError
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile.
What can I do to fix this?
According to the error, you need to add sqlite3 gem to your Gemfile (it's just a plain text file that should be on your Redmine root folder). Edit it and add something like.-
gem 'sqlite3'
You may also find this thread useful.-
Ruby on Rails - "Add 'gem sqlite3'' to your Gemfile"

Setting up production server on development machine to work with the rails 3 asset pipeline

On my local machine running in production mode (ie, rails s -e production) using webrick, I've generated the css using RAILS_ENV=production bundle exec rake assets:precompile, which creates application-d2bcfd35ef1c0c30b7a7ca94e52c0cbd.css, which the layout file also references.
However when loading the page I get the error:
Started GET "/assets/application-d2bcfd35ef1c0c30b7a7ca94e52c0cbd.css" for 127.0.0.1 at 2011-11-02 10:12:55 +0000
AbstractController::ActionNotFound (The action 'application-d2bcfd35ef1c0c30b7a7ca94e52c0cbd' could not be found for AssetsController):
actionpack (3.1.1) lib/abstract_controller/base.rb:116:in `process'
actionpack (3.1.1) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.1) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.1) lib/action_controller/metal.rb:236:in `block in action'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:29:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in `call'
newrelic_rpm (3.2.0) lib/new_relic/rack/browser_monitoring.rb:18:in `call'
airbrake (3.0.4) lib/airbrake/rack.rb:27:in `call'
sass (3.1.10) lib/sass/plugin/rack.rb:54:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.5) lib/rack/etag.rb:23:in `call'
rack (1.3.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.1) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
rack (1.3.5) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
rack-cache (1.1) lib/rack/cache/context.rb:132:in `forward'
rack-cache (1.1) lib/rack/cache/context.rb:241:in `fetch'
rack-cache (1.1) lib/rack/cache/context.rb:181:in `lookup'
rack-cache (1.1) lib/rack/cache/context.rb:65:in `call!'
rack-cache (1.1) lib/rack/cache/context.rb:50:in `call'
airbrake (3.0.4) lib/airbrake/user_informer.rb:12:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
/Users/ttt/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/ttt/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/ttt/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
I read in the configuring rails guide:
config.serve_static_assets configures Rails itself to serve static
assets. Defaults to true, but in the production environment is turned
off as the server software (e.g. Nginx or Apache) used to run the
application should serve static assets instead. Unlike the default
setting set this to true when running (absolutely not recommended!) or
testing your app in production mode using WEBrick. Otherwise you won´t
be able use page caching and requests for files that exist regularly
under the public directory will anyway hit your Rails app.
So changing config.serve_static_assets to true for production.rb references the files correctly. Is there a way of configuring webrick to serve asset pipeline files? Or is there any other rails server that is easy to set up for my development machine to run in production mode?
I'm running on Mac OS 10.6 (Snow Leopard) with an Apache web server.
You could clone your production environment for Vagrant (RailsCasts episode), which would make production enviorment testing on development machine more realistic.
or
You could create new environment for testing production settings and mark config.serve_static_assets to true.
or
You could try to use other servers like thin...
Probably the first one would give you most precise result how it would work on production and you would not use Webrick nor Thin in production.

Resources