Gem Dependency Problems With Legacy App - ruby-on-rails

I've inherited a rails 2.2 app and I'm having some trouble getting my local enviornment configured in a way that will allow me to work. Booting WEBrick gives me the following error:
./script/server
=> Booting WEBrick...
/Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/gem_dependency.rb:224:in `specification': undefined method `version_requirements=' for #<Gem::Dependency:0x10b1ec6a0> (NoMethodError)
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `plugins'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `inject'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `each'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `inject'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/locator.rb:81:in `plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:63:in `locate_plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:62:in `map'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:62:in `locate_plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:27:in `all_plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:22:in `plugins'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/rails/plugin/loader.rb:45:in `add_plugin_load_paths'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/initializer.rb:269:in `add_plugin_load_paths'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/initializer.rb:135:in `process'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
from /Users/swachtma/htdocs/skating_circle/config/environment.rb:20
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `gem_original_require'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/commands/servers/webrick.rb:59
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `gem_original_require'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
from /Users/swachtma/.rvm/gems/ruby-1.8.7-p371#skating/gems/rails-2.2.2/lib/commands/server.rb:49
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `gem_original_require'
from /Users/swachtma/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:54:in `require'
from ./script/server:3
I suspect I may need to downgrade my version of ruby-gems but I'm at a loss as to how to determine and appropriate version.
These are my local gems:
*** LOCAL GEMS ***
actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
aws-s3 (0.6.3)
builder (3.1.4)
bundler (1.2.3)
contacts (1.2.4)
diff-lcs (1.1.3)
fastercsv (1.5.5)
gdata (1.1.1)
heywatch (1.2.0)
highline (1.6.15)
hoptoad_notifier (2.4.11)
hpricot (0.8.6)
json (1.7.6)
mime-types (1.19)
mini_magick (3.4)
net-ssh (2.6.3)
rack (1.5.1)
rails (2.2.2)
rake (10.0.3, 0.8.7)
rest-client (1.6.7)
rspec (2.12.0, 1.3.2)
rspec-core (2.12.2, 2.6.4)
rspec-expectations (2.12.1, 2.6.0)
rspec-mocks (2.12.2, 2.6.0)
rspec-rails (1.3.2)
rubygems-bundler (1.1.0)
rubygems-update (1.4.2)
rvideo (0.9.3)
rvm (1.11.3.6)
subexec (0.2.2)
will_paginate (2.2.2)
xml-simple (1.1.2)

For Rails 2.2 gem version 1.4.2 works I guess. Try downgrading to 1.4.2
sudo gem update --system 1.4.2 or rvm install rubygems 1.4.2

Try this
gem install rubygems-update -v='1.4.2'
gem uninstall rubygems-update -v='1.5.0'
update_rubygems
Also, refer to these questions:
Gem dependency error in rails 2.3.4
ruby on rails: undefined method "version_requirements' when attempting to start server after new install

Related

Unable to identify the object from ruby library

I recently updated the OS to ELcaptain and ever since my feature files are failing and not identifying object.
This is the error I get in terminal when I run a file:
cannot load such file -- rspec (LoadError)
/Users/xyz/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `require'
/Users/xyz/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
/Users/xyz/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
/Users/xyz/ttv-cucumber/helper/auto_loader.rb:14:in `<top (required)>'
/Users/xyz/ttv-cucumber/flow-combo-selection/features/support/common.rb:1:in `require_relative'
/Users/xyzr/ttv-cucumber/flow-combo-selection/features/support/common.rb:1:in `<top (required)>'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/rb_support/rb_language.rb:99:in `load'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/rb_support/rb_language.rb:99:in `load_code_file'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:232:in `load_file'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:99:in `block in load_files!'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:98:in `each'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/runtime/support_code.rb:98:in `load_files!'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/runtime.rb:262:in `load_step_definitions'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/runtime.rb:65:in `run!'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/lib/cucumber/cli/main.rb:32:in `execute!'
/Users/xyz/.rvm/gems/ruby-2.1.6/gems/cucumber-2.1.0/bin/cucumber:8:in `<top (required)>'
/Users/xyz/.rvm/gems/ruby-2.1.6/bin/cucumber:23:in `load'
/Users/xyz/.rvm/gems/ruby-2.1.6/bin/cucumber:23:in `<main>'
/Users/xyz/.rvm/gems/ruby-2.1.6/bin/ruby_executable_hooks:15:in `eval'
/Users/xyz/.rvm/gems/ruby-2.1.6/bin/ruby_executable_hooks:15:in `<main>'
And on the step definitions I get this error:
undefined method `expect' for #<Object:0x007fb6b1d1ac80> (NoMethodError)
This is my gem list:
appium_lib (8.0.0, 4.1.0)
awesome_print (1.6.1)
bigdecimal (1.2.7, 1.2.4)
blankslate (3.1.3, 2.1.2.4)
builder (3.2.2)
bundler-unload (1.0.2)
childprocess (0.5.8, 0.5.6)
chunky_png (1.3.5, 1.3.4)
coderay (1.1.0)
cucumber (2.0.0)
cucumber-core (1.3.0, 1.1.3)
diff-lcs (1.2.5)
executable-hooks (1.3.2)
ffi (1.9.10, 1.9.8)
gem-wrappers (1.2.7)
gherkin (2.12.2)
gherkin3 (3.1.2)
io-console (0.4.3)
jar_wrapper (0.1.8)
json (1.8.3, 1.8.1)
method_source (0.8.2)
mini_portile (0.6.2)
minitest (5.8.2, 4.7.5)
multi_json (1.11.1)
multi_test (0.1.2)
nokogiri (1.6.6.2)
parslet (1.5.0)
power_assert (0.2.6)
pry (0.10.1)
psych (2.0.5)
rake (10.1.0)
rdoc (4.1.0)
rmagick (2.15.2)
rspec (3.3.0)
rspec-core (3.3.0)
rspec-expectations (3.3.0)
rspec-mocks (3.3.0)
rspec-support (3.3.0)
rubygems-bundler (1.4.4)
rubytest (0.8.1)
rubyzip (1.1.7)
rvm (1.11.3.9)
selenium (0.2.11)
selenium-cucumber (2.1.3)
selenium-webdriver (2.45.0)
slop (3.6.0)
test (1.0.0)
test-unit (2.1.6.0)
toml (0.1.2)
websocket (1.2.2)
zip (2.0.2)
Please try this if you haven't already:
run bundle install
If you do not have a spec helper or rails helper in the spec directory, run this: rails generate rspec:install

Error using activerecord-sqlserver-adapter

I installed activerecord-sqlserver-adapter such that it appears in my local gems.
Running the command...
rails generate scaffold Tablename fieldname:fieldtype
returns an error (as below). I've rails 1.9.2 installed. Any guidance or assistance would be much appreciated. Thanks
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:251:in `require': Please install the sqlserver adapter: `gem install activerecord-sqlserver-adapter` (no such file to load -- active_record/connection_adapters/sqlserver_adapter) (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:129:in `establish_connection'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/lazy_load_hooks.rb:42:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/active_record/base.rb:721:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/generators/named_base.rb:166:in `pluralize_table_names?'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/generators/named_base.rb:114:in `table_name'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.8/lib/rails/generators/active_record/model/model_generator.rb:17:in `create_migration_file'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:109:in `invoke'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/group.rb:281:in `block in _invoke_for_class_method'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/shell.rb:74:in `with_padding'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/group.rb:270:in `_invoke_for_class_method'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/group.rb:150:in `_invoke_from_option_orm'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-.2.8/lib/active_support/dependencies.rb:251:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
* LOCAL GEMS *
actionmailer (3.2.8, 3.1.0, 2.2.3)
actionpack (3.2.8, 3.1.0, 2.2.3)
activemodel (3.2.9, 3.2.8, 3.1.0)
activerecord (3.2.8, 3.1.0)
activerecord-sqlserver-adapter (3.2.10, 3.1.7)
activeresource (3.2.8, 3.1.0)
activesupport (3.2.9, 3.2.8, 3.1.0, 2.2.3)
ansi (1.4.3, 1.3.0)
archive-tar-minitar (0.5.2)
arel (3.0.2, 2.2.1)
bcrypt-ruby (3.0.1 x86-mingw32)
builder (3.0.4, 3.0.0)
bundler (1.2.1)
coffee-rails (3.2.2, 3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.4.0, 1.1.2)
columnize (0.3.6)
erubis (2.7.0)
execjs (1.4.0, 1.2.9)
ffi (1.1.5)
hike (1.2.1)
i18n (0.6.1, 0.6.0)
journey (1.0.4)
jquery-rails (2.1.4, 2.1.3, 1.0.14)
json (1.7.5, 1.6.1)
linecache19 (0.5.12)
mail (2.4.4, 2.3.0)
mime-types (1.19, 1.16)
minitest (4.1.0, 3.5.0, 3.4.0, 1.6.0)
multi_json (1.4.0, 1.3.7, 1.3.6, 1.0.3)
nokogiri (1.5.5 x86-mingw32)
polyglot (0.3.3, 0.3.2)
rack (1.4.1, 1.3.4)
rack-cache (1.2, 1.0.3)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.2, 0.6.1)
rails (3.2.8, 3.1.0)
railties (3.2.8, 3.1.0)
rake (10.0.2, 10.0.1, 0.9.2.2, 0.9.2, 0.8.7)
rdiscount (1.6.8)
rdoc (3.12, 3.10, 2.5.8)
ruby-debug-base19 (0.11.25)
ruby-debug-ide (0.4.16)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)
sass (3.2.3, 3.1.10)
sass-rails (3.2.5, 3.1.4)
sprockets (2.1.3, 2.0.2)
sqlite3 (1.3.6 x86-mingw32, 1.3.4 x86-mingw32)
sqlite3-ruby (1.3.3)
thor (0.16.0, 0.14.6)
tilt (1.3.3)
tiny_tds (0.5.1 x86-mingw32)
tmail (1.2.7.1)
treetop (1.4.12, 1.4.11, 1.4.10)
turn (0.9.6, 0.8.3)
tzinfo (0.3.35, 0.3.30)
uglifier (1.3.0, 1.0.3)
win32-sound (0.5.0)
Is the gem listed in your Gemfile?
Add to your gemfile (gem manual)
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter', '~> 3.1.0'
and run bundle install again
Finally resolved this. To fix I uninstalled 2 conflicting versions of activerecord-sqlserver-adapter, installed ruby-odbc gem, installed activerecord-sqlserver-adapter, tweaked the gemfile to reflect correct versions then ran bundle update, then bundle install and lastly the rails generate scaffold... command.

undefined method `mount_uploader' for Category:Class Mongoid Nginx Passenger

I'm using carrierwave in my application. The problem is it works well in development mode. But when deploying to nginx with passenger it throws the following error:
/home/webserver/raw/releases/20110919033346/app/models/category.rb:11: undefined method `mount_uploader' for Category:Class (NoMethodError)
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:454:in `load'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:454:in `load_file'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:453:in `load_file'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:340:in `require_or_load'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:300:in `depend_on'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:216:in `require_dependency'
from /opt/ruby/lib/ruby/gems/1.8/gems/mongoid-2.0.1/lib/rails/mongoid.rb:55:in `load_model'
from /opt/ruby/lib/ruby/gems/1.8/gems/mongoid-2.0.1/lib/rails/mongoid.rb:18:in `load_models'
from /opt/ruby/lib/ruby/gems/1.8/gems/mongoid-2.0.1/lib/rails/mongoid.rb:17:in `each'
from /opt/ruby/lib/ruby/gems/1.8/gems/mongoid-2.0.1/lib/rails/mongoid.rb:17:in `load_models'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/paths.rb:102:in `each'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/paths.rb:102:in `each'
from /opt/ruby/lib/ruby/gems/1.8/gems/mongoid-2.0.1/lib/rails/mongoid.rb:16:in `load_models'
from /opt/ruby/lib/ruby/gems/1.8/gems/mongoid-2.0.1/lib/mongoid/railtie.rb:88:in `_callback_before_5'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:420:in `_run_prepare_callbacks'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/stack.rb:33:in `new'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/stack.rb:33:in `build'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:209:in `inject'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/stack.rb:79:in `each'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/stack.rb:79:in `inject'
from /opt/ruby/lib/ruby/gems/1.8/gems/actionpack-3.0.9/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:162:in `build_middleware_stack'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application/finisher.rb:35
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `instance_exec'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `run_initializers'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `each'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `run_initializers'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:134:in `initialize!'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:77:in `send'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
from /home/webserver/raw/releases/20110919033346/config/environment.rb:5
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:225:in `load_dependency'
from /opt/ruby/lib/ruby/gems/1.8/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/application.rb:103:in `require_environment!'
from /opt/ruby/lib/ruby/gems/1.8/gems/railties-3.0.9/lib/rails/commands.rb:22
from script/rails:6:in `require'
from script/rails:6
Here is my gem list
abstract (1.0.0)
actionmailer (3.0.9, 3.0.7)
actionpack (3.0.9, 3.0.7)
activemodel (3.0.9, 3.0.7)
activerecord (3.0.9, 3.0.7)
activeresource (3.0.9, 3.0.7)
activesupport (3.1.0, 3.0.9, 3.0.7)
akami (1.0.0)
arel (2.0.10)
bcrypt-ruby (3.0.0)
bson (1.3.1)
bson_ext (1.3.1)
builder (3.0.0, 2.1.2)
bundle (0.0.1)
bundler (1.0.13)
carrierwave (0.5.7, 0.5.6, 0.5.4)
daemon_controller (0.2.6)
erubis (2.6.6)
escape (0.0.4)
exception_notification_rails3 (1.2.0)
fastthread (1.0.7)
gyoku (0.4.4)
httpi (0.9.5, 0.9.4)
i18n (0.6.0, 0.5.0)
mail (2.2.19)
mime-types (1.16)
mini_magick (3.3, 3.2.1)
mongo (1.3.1)
mongoid (2.0.1)
multi_json (1.0.3)
nokogiri (1.5.0, 1.4.4)
nori (1.0.2, 0.2.2)
passenger (3.0.7)
polyglot (0.3.2, 0.3.1)
pr_geohash (1.0.0)
pyu-ntlm-http (0.1.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.9, 3.0.7)
railties (3.0.9, 3.0.7)
rake (0.9.2, 0.9.0)
rdoc (3.9.4, 3.8)
rmagick (2.13.1)
rsolr (0.12.1)
rubyzip (0.9.4)
savon (0.9.7, 0.9.6, 0.9.2)
subexec (0.1.0, 0.0.4)
sunspot (1.2.1)
sunspot_rails_mongoid (1.2.1)
SystemTimer (1.2.3)
thor (0.14.6)
treetop (1.4.10, 1.4.9)
tzinfo (0.3.29, 0.3.27)
wasabi (2.0.0)
will_paginate (3.0.0, 3.0.pre4, 3.0.pre2)
The ruby version is ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02
Please, could give any idea about this.
Thank you in advance!
I had the the same / a similar problem. In my case, it was something silly. In my Gemfile, I just referenced the gem, but you need to require the mongoid extension. So your line in the Gemfile should look like this:
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'

Error "uninitialized constant Rails::Engine (NameError)"

I am trying to join a Rails project. This project uses rails 2.3.8 and Ruby 1.8.7 so I am using RVM. I am also using gem v1.3.7
When I fire up the server, everything is ok. But then, when I try to access it through my browser, it crashes and I get the following trace:
/Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Rails::Engine (NameError)
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/devise_invitable-0.3.6/lib/devise_invitable/rails.rb:2
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/devise_invitable-0.3.6/lib/devise_invitable.rb:16
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:in `load'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/initializer.rb:307:in `each'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/initializer.rb:307:in `load_gems'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/initializer.rb:169:in `process'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
from /Users/ca/Documents/Project/Sources/Project-test/config/environment.rb:9
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/ca/.rvm/gems/ruby-1.8.7-p334/gems/rails-2.3.8/lib/commands/server.rb:84
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Users/ca/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from ./script/server:3
Here are my installed gems:
actionmailer (2.3.8)
actionpack (2.3.8)
activemodel (3.0.5)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (3.0.5, 2.3.8)
addressable (2.2.4)
arel (2.0.9)
aws (2.4.4)
aws-s3 (0.6.2)
bcrypt-ruby (2.1.4)
builder (3.0.0, 2.1.2)
client_side_validations (2.9.9)
crack (0.1.8)
daemons (1.1.0)
dalli (1.0.2)
delayed_job (2.0.3)
devise (1.1.7)
devise_invitable (0.3.6)
faraday (0.5.7, 0.4.6)
fb_graph (1.5.3)
googlecharts (1.6.1)
http_connection (1.4.0)
httparty (0.7.4)
i18n (0.5.0)
json (1.5.1, 1.4.3)
mime-types (1.16)
multi_json (0.0.5)
multipart-post (1.1.0)
net-ldap (0.1.1)
nokogiri (1.4.4)
oa-basic (0.1.5)
oa-core (0.1.5)
oa-enterprise (0.1.5)
oa-oauth (0.1.5)
oa-openid (0.1.5)
oauth (0.4.4)
oauth2 (0.1.1, 0.0.13)
omniauth (0.1.5)
paperclip (2.3.8)
pyu-ruby-sasl (0.0.3.2)
rack (1.1.1)
rack-openid (1.1.2)
rails (2.3.8)
rake (0.8.7)
RedCloth (4.2.7)
rest-client (1.6.1)
ruby-openid (2.1.8)
ruby-openid-apps-discovery (1.2.0)
rubygems-update (1.3.7)
rubyntlm (0.1.1)
tzinfo (0.3.24)
uuidtools (2.1.2)
validates_timeliness (2.3.0)
validation_reflection (0.3.7)
validation_reflection-active_model (0.3.1)
warden (1.0.3)
will_paginate (2.3.15)
xml-simple (1.0.14)
Where does the problem come from?
Thank you very much for your help!
Your version of the DeviseInvitable is too new for Rails 2.3.
DeviseInvitable currently only support Rails 3, if you want to use it with Rails 2.3 you must install version 0.2.3
As is Devise 1.1
Support for Rails 2.3.x can be found by installing Devise 1.0.x from the v1.0 branch.
Run
gem uninstall devise devise_invitable
gem install devise --version 1.0.10
gem install devise_invitable --version 0.2.3

No such file to load -- zip/zip (MissingSourceFile) when running cucumber

It was been a long time I haven't run cucumber in my project. It's running good before but now, when I try to run cucumber features, I have this error:
Using the default profile...
no such file to load -- zip/zip (MissingSourceFile)
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
/home/florence/NetBeansProjects/famicity/app/controllers/albums_controller.rb:1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:265:in `require_or_load'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:224:in `depend_on'
/home/florence/NetBeansProjects/famicity/vendor/rails/activesupport/lib/active_support/dependencies.rb:136:in `require_dependency'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:414:in `load_application_classes'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:413:in `each'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:413:in `load_application_classes'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:411:in `each'
/home/florence/NetBeansProjects/famicity/vendor/rails/railties/lib/initializer.rb:411:in `load_application_classes'
/home/florence/NetBeansProjects/famicity/config/../vendor/rails/railties/lib/initializer.rb:197:in `process'
/home/florence/NetBeansProjects/famicity/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
/home/florence/NetBeansProjects/famicity/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
/home/florence/NetBeansProjects/famicity/config/environment.rb:14
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/NetBeansProjects/famicity/features/support/env.rb:8
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/home/florence/.gem/ruby/1.8/gems/polyglot-0.2.9/lib/polyglot.rb:70:in `require'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/rb_support/rb_language.rb:124:in `load_code_file'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:84:in `load_code_file'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:76:in `load_code_files'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:75:in `each'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/step_mother.rb:75:in `load_code_files'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/cli/main.rb:48:in `execute!'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/home/florence/.gem/ruby/1.8/gems/cucumber-0.6.2/bin/cucumber:8
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19
Herewith, my gem list :
actionmailer (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.3.3)
actionpack (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.13.3)
actionwebservice (1.2.3)
activerecord (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.15.3)
activeresource (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2)
activesupport (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 1.4.2)
adzap-ar_mailer (2.1.8, 2.1.5)
aws-s3 (0.6.2)
builder (2.1.2)
calendar_date_select (1.16.1, 1.15)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
color (1.4.1)
contacts (1.2.3)
cucumber (0.6.2)
cucumber-rails (0.2.4)
daemons (1.0.10)
database_cleaner (0.5.0, 0.4.3)
devise (1.0.7)
diff-lcs (1.1.2)
digitalpardoe-rflickr (1.1.2)
eventmachine (0.12.8)
facebooker (1.0.44)
fastercsv (1.5.0)
fastthread (1.0.7)
gdata (1.1.1)
gem_plugin (0.2.3)
geokit (1.5.0)
hoe (2.3.2)
hpricot (0.8.1)
icalendar (1.1.4)
json (1.1.7)
json_pure (1.4.3, 1.2.0)
levenshtein (0.2.0)
lockfile (1.4.3)
macaddr (1.0.0)
memcache-client (1.7.4)
mime-types (1.16)
mocha (0.9.7)
money (2.1.4)
mongrel (1.1.5)
mysql (2.8.1, 2.7)
net-http-persistent (1.2.1)
newrelic_rpm (2.9.9)
nokogiri (1.4.1)
objectify-xml (0.2.3)
packet (0.1.15)
paperclip (2.3.1.1)
paypal (2.0.0)
pdf-writer (1.1.8)
polyglot (0.2.9)
rack (1.0.1, 1.0.0)
rack-test (0.5.3)
rails (2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.3.2)
rake (0.8.7)
rc-rest (4.0)
rest-client (1.0.3)
rflickr (2006.02.01)
rmagick (2.13.1)
rspec (1.3.0)
rspec-rails (1.3.2)
ruby-picasa (0.2.1)
rubyforge (2.0.4, 1.0.4)
rubygems-update (1.3.4)
rvideo-tecnobrat (0.9.4)
selenium-client (1.2.18)
term-ansicolor (1.0.4)
thin (1.2.7, 1.2.2)
transaction-simple (1.4.0)
treetop (1.4.3)
trollop (1.16.2)
ultrasphinx (1.11)
uuid (2.3.1)
validates_timeliness (2.2.2)
viddler (0.2.2)
warden (0.10.7)
webrat (0.7.0)
will_paginate (2.2.2)
xml-magic (0.1.1)
xml-simple (1.0.12)
Any help will be appreciate.
Thank's in advance.
Solutions above did not work. Solution for me was to require rubyzip version less than 1.0 i.e.
gem 'rubyzip', '~> 0.9.9'
It seems the latest selenium-webdriver now requires rubyzip < 1.0.0 so this shouldn't be a problem anymore but posting in case of it happens to someone else.
I found my answer, the problem is about a gem named "rubyzip" that missed in my gem list.
I don't quite understand the source of this error. It seems like a missing dependency of Active Support. Anyway, I was able to get past the error by explicitly adding the gem and requiring it in my Gemfile:
gem 'rubyzip', :require => 'zip/zip'
This is an interface-breaking change when moving rubyzip from 0.9.9 to 1.0.0. The issue is described here.
As a short-cut back to working, you may be interested in the zip-zip gem.
I had this issue as well when trying to run cucumber after updating selenium-webdriver.
The newest version of selenium now requires rubyzip ~> 1.0, which you will need to put in your Gemfile and explicitly require:
gem 'rubyzip', require: 'zip'
When using phusion passenger it seems that the gems have to be installed globally.
When I ran 'gem install ' from within my project directory it showed the gem as being installed but still resulted in the 'no such file to load...' error.
On a hunch I went outside the project directory and did a 'gem list' and the gem installed above was not listed, so I did 'gem install ' outside of the project directory and the error was fixed.
Please not that this was Phusion Passenger implementation not just rails.

Resources