when running $ rails test, I get the error as below, how to solve this problem?
/home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/testing/declarative.rb:14:in 'test': test_should_get_help is already defined in StaticPagesControllerTest (RuntimeError)
from /home/nafihnafi/workspace/sample_app/test/controllers/static_pages_controller_test.rb:10:in '<class:StaticPagesControllerTest>'
from /home/nafihnafi/workspace/sample_app/test/controllers/static_pages_controller_test.rb:3:in '<top (required)>'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in 'require'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in 'block in require'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in 'load_dependency'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in 'require'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:14:in 'block in require_files'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:13:in 'each'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.1.1/lib/rails/test_unit/test_requirer.rb:13:in 'require_files'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.1.1/lib/rails/test_unit/minitest_plugin.rb:94:in 'plugin_rails_init'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:81:in 'block in init_plugins'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:79:in 'each'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:79:in 'init_plugins'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:130:in 'run'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.1.1/lib/rails/test_unit/minitest_plugin.rb:77:in 'run'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:63:in 'block in autorun'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from /home/nafihnafi/.rbenv/versions/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from -e:1:in '<main>'
You're defining test_should_get_help somewhere again, when it's already been defined. Make sure it's only defined once - put the function in a private block at the end of the file like this:
[file end]
private
def test_should_get_help
[blah]
end
If you need it in multiple files, try adding it as a helper.
Related
I have a rails app on my server which runs perfectly when I do rails s -b domain.name but when I run rails s -b domain.name -e production or RAILS_ENV=production rails s -b domain.name I have this following error.
=> Booting Puma
=> Rails 4.2.6 application starting in production on http://domain.name:3000
=> Run 'rails server -h' for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:244:in 'rescue in load_dependency': /home/deploy/appname/app/controllers/users/confirmations_controller.rb:2: unknown regexp options - cfrat (SyntaxError)
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:7: unknown regexp options - cfrat
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:12: unknown regexp options - cfrat
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:13: syntax error, unexpected keyword_def, expecting ':'
def show
^
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:27: syntax error, unexpected keyword_end, expecting end-of-input
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:237:in 'load_dependency'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:360:in 'require_or_load'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:317:in 'depend_on'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:233:in 'require_dependency'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:472:in 'block (2 levels) in eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:471:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:471:in 'block in eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:469:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:469:in 'eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:346:in 'eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application/finisher.rb:56:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application/finisher.rb:56:in 'block in <module:Finisher>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 'instance_exec'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 'run'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in 'block in run_initializers'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:228:in 'block in tsort_each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:350:in 'block (2 levels) in each_strongly_connected_component'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:431:in 'each_strongly_connected_component_from'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:349:in 'block in each_strongly_connected_component'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in 'call'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in 'each_strongly_connected_component'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:226:in 'tsort_each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:205:in 'tsort_each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in 'run_initializers'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application.rb:352:in 'initialize!'
from /home/deploy/appname/config/environment.rb:5:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'block in require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in 'load_dependency'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'require'
from /home/deploy/appname/config.ru:3:in 'block in <main>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 'instance_eval'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 'initialize'
from /home/deploy/appname/config.ru:in 'new'
from /home/deploy/appname/config.ru:in '<main>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 'eval'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 'new_from_string'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in 'parse_file'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:299:in 'build_app_and_options_from_config'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:208:in 'app'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:61:in 'app'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:336:in 'wrapped_app'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:272:in 'start'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in 'start'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in 'block in server'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in 'tap'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in 'server'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in 'run_command!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in '<top (required)>'
from /home/deploy/appname/bin/rails:9:in 'require'
from /home/deploy/appname/bin/rails:9:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in 'load'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in 'call'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client/command.rb:7:in 'call'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client.rb:30:in 'run'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/bin/spring:49:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in 'load'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from /home/deploy/appname/bin/spring:13:in '<top (required)>'
from bin/rails:3:in 'load'
from bin/rails:3:in '<main>'
Edit
And this is the file causing the error :
/home/deploy/appname/app/controllers/users/confirmations_controller.rb
class Users::ConfirmationsController < Devise::ConfirmationsController
GET /resource/confirmation/new
def new
super
end
POST /resource/confirmation
def create
super
end
GET /resource/confirmation?confirmation_token=abcdef
def show
super
end
protected
The path used after resending confirmation instructions.
def after_resending_confirmation_instructions_path_for(resource_name)
super(resource_name)
end
The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
super(resource_name, resource)
end
end
The error seems to come from Devise auto generated files but I cannot figure out why it happens only in prodcution mode.
I think you tried to override the devise default behaviour using rails generate devise:controllers and you may have changed them badly.
Please be sure that:
You need to override the default controllers, unless you can remove controllers/users folder (If the name of your model you applied Devise on is Users)
Check syntax in all the files in controller/users.
I have an application on Heroku that uses the Paperclip gem that recently had some issues - and I'm not 100% sure on what it was that caused it. I have the application working locally (including the image upload) - but I get an 'Application Error' page on the heroku url, and when I try to access the heroku console with heroku run rails c it gets an error of:
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in 'method_missing': undefined method '_image_post_process_callbacks' for #<Class:0x007f8aaf5d2fa0> (NoMethodError)
A little background on the issue - another developer was working on creating an image upload model - which was named 'Images' - which I think caused problems with Paperclip, and wouldn't allow me to run a Rails migration. When I tried it said there was an issue with the 'Images' table, so after finding a similar situation online, I commented out the body of the 'def change' within the create_images migration - which now looks like so:
class CreateImages < ActiveRecord::Migration
def change
# create_table :images do |t|
# t.attachment :file
# end
end
end
I then ran another migration - started my server locally and everything was working. I then pushed my changes to heroku, did a rake db:migrate for good luck - and the heroku url is still showing 'Application Error'
If anyone has any idea of possible causes of these issues, it would be greatly appreciated! Thanks for reading!
EDIT
After running heroku run rails c I get this output.
Running rails c on independentskiermag... up, run.7049
Routing about
Routing terms-of-service
Routing privacy-policy
Routing contact
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in 'method_missing': undefined method '_image_post_process_callbacks' for #<Class:0x007f9ff5864330> (NoMethodError)
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:785:in 'get_callbacks'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/callbacks.rb:647:in 'set_callback'
from (eval):2:in 'before_image_post_process'
from /app/vendor/bundle/ruby/2.0.0/gems/paperclip-4.3.2/lib/paperclip/validators.rb:67:in 'create_validating_before_filter'
from /app/vendor/bundle/ruby/2.0.0/gems/paperclip-4.3.2/lib/paperclip/validators.rb:60:in 'block in validate_before_processing'
from /app/vendor/bundle/ruby/2.0.0/gems/paperclip-4.3.2/lib/paperclip/validators.rb:58:in 'each'
from /app/vendor/bundle/ruby/2.0.0/gems/paperclip-4.3.2/lib/paperclip/validators.rb:58:in 'validate_before_processing'
from /app/vendor/bundle/ruby/2.0.0/gems/paperclip-4.3.2/lib/paperclip/validators/attachment_content_type_validator.rb:84:in 'validates_attachment_content_type'
from /app/app/models/image.rb:4:in '<class:Image>'
from /app/app/models/image.rb:1:in '<top (required)>'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in 'require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in 'block in require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in 'load_dependency'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in 'require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:360:in 'require_or_load'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:317:in 'depend_on'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:233:in 'require_dependency'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/engine.rb:472:in 'block (2 levels) in eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/engine.rb:471:in 'each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/engine.rb:471:in 'block in eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/engine.rb:469:in 'each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/engine.rb:469:in 'eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/engine.rb:346:in 'eager_load!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:56:in 'each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:56:in 'block in <module:Finisher>'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in 'instance_exec'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in 'run'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in 'block in run_initializers'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:150:in 'block in tsort_each'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:183:in 'block (2 levels) in each_strongly_connected_component'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:219:in 'each_strongly_connected_component_from'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:182:in 'block in each_strongly_connected_component'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in 'each'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:180:in 'each_strongly_connected_component'
from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/tsort.rb:148:in 'tsort_each'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in 'run_initializers'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/application.rb:352:in 'initialize!'
from /app/config/environment.rb:5:in '<top (required)>'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in 'require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in 'block in require'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in 'load_dependency'
from /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in 'require'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/application.rb:328:in 'require_environment!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:142:in 'require_application_and_environment!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:67:in 'console'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in 'run_command!'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in '<top (required)>'
from /app/bin/rails:8:in 'require'
from /app/bin/rails:8:in '<main>'
First off, if you need to undo a migration on Heroku, you will need to un-comment out the body of your migration, push to Heroku, then run heroku run rake db:rollback in order to undo it and get your application working again in the interim.
If you are still having trouble, post the errors and any relevant code in your post.
Whenever I'm trying to run rspec for whole project (there are over 1000 tests) after finishing all testcases I receive following error:
/home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:183:in `formatted_backtrace': undefined method `backtrace' for nil:NilClass (NoMethodError)
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:191:in `colorized_formatted_backtrace'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:276:in `formatted_message_and_backtrace'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:199:in `fully_formatted'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:122:in `block in fully_formatted_pending_examples'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:121:in `each'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:121:in `each_with_index'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/notifications.rb:121:in `fully_formatted_pending_examples'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/formatters/base_text_formatter.rb:50:in `dump_pending'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/reporter.rb:146:in `block in notify'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/reporter.rb:145:in `each'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/reporter.rb:145:in `notify'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/reporter.rb:123:in `finish'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/reporter.rb:64:in `report'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:108:in `run_specs'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:86:in `run'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:70:in `run'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/lib/rspec/core/runner.rb:38:in `invoke'
from /home/borisano/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.2/exe/rspec:4:in `<top (required)>'
from /home/borisano/.rbenv/versions/2.1.5/bin/rspec:23:in `load'
from /home/borisano/.rbenv/versions/2.1.5/bin/rspec:23:in `<main>'
When I run only limited number of test cases, say, one file or single folder, everything works fine.
Here's my .rspec file
--color
--require rails_helper
and spec_helper.rb
require "rack_session_access/capybara"
RSpec.configure do |config|
end
So nothing suspicious, as for me
Any ideas on how to fix that?
Add this to your .rspec file:
--require spec_helper
This guarantees that your spec_helper is required before each spec.
I've installed ember-appkit-rails, but when I do rails g ember:bootstrap I get the following error can anyone help?
/home/ltsimps/.rvm/ruby-1.9.3-p392/gems/ember-appkit-rails-0.3.0/lib/ember/appkit/rails/sprockets/context.rb:10:in '': undefined method prepend' for Sprockets::Context:Class (NoMethodError)
from /home/ltsimps/.rvm/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in 'require'
from /home/ltsimps/.rvm/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228 'block in require'
from /home/ltsimps/.rvm/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213 'load_dependency'
from /home/ltsimps/.rvm/ruby-1.9.3-p392/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228 'require'
from /home/ltsimps/.rvm/ruby-1.9.3-p392/gems/ember-appkit-rails-0.3.0/lib/ember/appkit/rails/sprockets.rb:3:in ....
I just changed to ruby 2.0 and that fixed the problem.
I'm trying to get Facebook logins working on my app using Rails, Authlogic, and Omniauth. I'm following the first steps of http://railscasts.com/episodes/235-omniauth-part-1 as precisely as possible.
I have:
added the omniauth gem, run bundle install.
created a new Authentication nifty-scaffold with fields user_id, provider, and uid.
added the route: match '/auth/:provider/callback' => 'authentications#create'
added to config/initializers/omniauth.rb:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, '20...my_app_id', 'bc...my_app_secret'
end
The server then fails to restart:
/Users/san/.rvm/gems/ruby-1.9.2-p0/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:
in 'const_missing_from_s3_library': uninitialized constant
OmniAuth::Strategies::Facebook (NameError)
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.2/lib/rake/ext/module.rb:36:in 'const_missing'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/omniauth-1.0.0/lib/omniauth/builder.rb:22:in 'const_get'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/omniauth-1.0.0/lib/omniauth/builder.rb:22:in 'provider'
from /Users/san/Documents/sanj/myapp/config/initializers/omniauth.rb:2:in 'block in <top (required)>'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/builder.rb:46:in 'instance_eval'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/builder.rb:46:in 'initialize'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/omniauth-1.0.0/lib/omniauth/builder.rb:7:in 'initialize'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.10/lib/action_dispatch/middleware/stack.rb:33:in 'new'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.10/lib/action_dispatch/middleware/stack.rb:33:in 'build'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.10/lib/action_dispatch/middleware/stack.rb:79:in 'block in build'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.10/lib/action_dispatch/middleware/stack.rb:79:in 'each'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.10/lib/action_dispatch/middleware/stack.rb:79:in 'inject'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.10/lib/action_dispatch/middleware/stack.rb:79:in 'build'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/application.rb:162:in 'app'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/application/finisher.rb:35:in 'block in <module:Finisher>'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/initializable.rb:25:in 'instance_exec'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/initializable.rb:25:in 'run'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/initializable.rb:50:in 'block in run_initializers'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/initializable.rb:49:in 'each'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/initializable.rb:49:in 'run_initializers'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/application.rb:134:in 'initialize!'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/application.rb:77:in 'method_missing'
from /Users/san/Documents/sanj/myapp/config/environment.rb:5:in '<top (required)>'
from /Users/san/Documents/sanj/myapp/config.ru:3:in 'block in <main>'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/builder.rb:46:in 'instance_eval'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/builder.rb:46:in 'initialize'
from /Users/san/Documents/sanj/myapp/config.ru:1:in 'new'
from /Users/san/Documents/sanj/myapp/config.ru:1:in '<main>'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/builder.rb:35:in 'eval'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/builder.rb:35:in 'parse_file'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/server.rb:162:in 'app'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/server.rb:253:in 'wrapped_app'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.3/lib/rack/server.rb:204:in 'start'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/commands/server.rb:65:in 'start'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/commands.rb:30:in 'block in <top (required)>'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/commands.rb:27:in 'tap'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.10/lib/rails/commands.rb:27:in '<top (required)>'
from script/rails:7:in 'require'
from script/rails:7:in '<main>'
I had to do 'require "omniauth"' or 'require "omniauth-facebook"' in my config/development.rb file.
The omniauth gem was just bumped to version 1.0 as of yesterday (http://intridea.com/2011/11/2/omniauth-1-0), and there are some changes to how the gem is used that are not covered in the railscast.
I found my solution on this page: https://github.com/intridea/omniauth/wiki/OmniAuth-1.0
The biggest different is that each strategy is now contained within its own gem, so for facebook, you would change the line in your gem file that currently reads "gem 'omniauth'" to "gem 'omniauth-facebook'".
I didn't have to change any other code, and you may have to run "bundle update" to get everything to click through.
I just ran into this problem and this is what was wrong with me:
You can't have your facebook oauth gem in the Development list in your gem file. Heroku only reads the Production ones, so move it up out of the Development list.