TextMate, Cucumber & Spork: Run feature **with** HTML output? - ruby-on-rails

I use Cucumber to test my Rails app, and thanks to a running Spork I don't have to start the whole Rails app every time I run a scenario.
I have set the TM_CUCUMBER_OPTS to --drb within TextMate, which works fine, but it results in awkward formatting of the results: it's only text, not HTML anymore.
Any way to fix that? I tried --format=html, but this results in:
Running: /Users/josh/.rvm/bin/rvm-auto-ruby /Users/josh/Documents/Work/Sientia/iq/script/cucumber
/Users/josh/Documents/Work/Sientia/iq/features/authorization/sign_out.feature --drb --format=html
Using the default profile...
Disabling profiles...
Exception encountered: #<RuntimeError: All but one formatter must use --out, only one can print to each stream (or STDOUT)>
backtrace:
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:198:in `arrange_formats'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:26:in `parse!'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:55:in `configuration'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:63:in `run_drb_client'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:34:in `execute!'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/test_framework/cucumber.rb:24:in `run_tests'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:13:in `block in run'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/josh/.rvm/gems/ruby-1.9.3-p0#iq/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
/Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
Any idea on how to fix this? Thanks.

Solution from Jim Drannbauer worked for me: http://jimdrannbauer.com/2011/02/22/cucumber-spork-textmate-drb-drbunknown/

Related

rails console not working due to no remaing live threads

I made a ActiveJob class for a background work collecting some data from the server and storing the data to my DB.
To make the job working, I added some trigger code as
# in config/environment.rb
MyJob.perform_later
# the perform method
def perform(*args)
update_db
MyJob.set(wait: 1.minutes).perform_later
end
But, after that suddenly, bin/rails console stoped working.
My rails version is '7.0.4' and ruby version is '3.1.2'
The error log is following:
$ ./bin/rails console
.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/base.rb:282:in `<module:ActiveRecord>': No live threads left. Deadlock? (fatal)
3 threads, 3 sleeps current:0x000000010b0e22b0 main thread:0x0000000139e04610
* #<Thread:0x0000000100fa4d48 sleep_forever>
rb_thread_t:0x0000000139e04610 native:0x000000010103c580 int:0
* #<Thread:0x0000000106403e48#DEBUGGER__::SESSION#server .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/debug-1.6.2/lib/debug/session.rb:154 sleep_forever>
rb_thread_t:0x000000010a6b9190 native:0x000000016f1b7000 int:0
* #<Thread:0x00000001065f1b60#worker-1 .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:332 sleep_forever>
rb_thread_t:0x000000010b0e22b0 native:0x000000016f3c3000 int:0
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/base.rb:15:in `<main>'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.1/lib/zeitwerk/kernel.rb:35:in `require'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/railtie.rb:62:in `block in <class:Railtie>'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/railtie.rb:273:in `block in run_console_blocks'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/railtie.rb:298:in `each'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/railtie.rb:298:in `each_registered_block'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/railtie.rb:273:in `run_console_blocks'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:526:in `block in run_console_blocks'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/engine/railties.rb:15:in `each'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/engine/railties.rb:15:in `each'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/application.rb:526:in `run_console_blocks'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/engine.rb:449:in `load_console'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/console/console_command.rb:35:in `initialize'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/console/console_command.rb:19:in `new'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/console/console_command.rb:19:in `start'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands/console/console_command.rb:102:in `perform'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from .asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from ./bin/rails:4:in `<main>'
I have searched any way to solve this problem but, I couldn't.
I just guess this problem is about the thread of ActiveJob or updating ActiveRecord(DB).
Please give me some help.
Thanks in advance!
The problem is caused by "MyJob.perform_later" in the "environment.rb" file. After I move the line to "config.after_initialize" block in "config/application.rb" file, I can use the console.

Adding custom template to mail_form gem

I'm attempting to follow the documentation for the Mail_form gem to add a custom email template. The documentation states:
To customize the e-mail template that is used create a file called contact.erb in app/views/mail_form. Take a look at lib/mail_form/views/mail_form/contact.erb in this repo to see how the default template works.
Also, I found this issue in the repo and did the same:
I created a mail_for.rb file in initializers and added MailForm::Notifier.template_root = File.join(Rails.root, "app", "views"), to the file.
I created a mail_form directory in views and added a contact.erb file and copied the default template to it.
However, when I restart the server I get the following error:
Booting WEBrick
=> Rails 4.2.5 application starting in development on http://localhost:3000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server Exiting /Users/Tony/.rvm/gems/ruby-2.2.1/gems/actionmailer-4.2.5/lib/action_mailer/base.rb:569:in
method_missing': undefined methodtemplate_root=' for
MailForm::Notifier:Class (NoMethodError) from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/config/initializers/mail_form.rb:1:in
<top (required)>' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:inload' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in block in load' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:inload_dependency' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in load' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/engine.rb:652:in
block in load_config_initializer' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/notifications.rb:166:in
instrument' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/engine.rb:651:in
load_config_initializer' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/engine.rb:616:in
block (2 levels) in <class:Engine>' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/engine.rb:615:in
each' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/engine.rb:615:in
block in <class:Engine>' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:30:in
instance_exec' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:30:in
run' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:55:in
block in run_initializers' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:226:in
block in tsort_each' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:348:in
block (2 levels) in each_strongly_connected_component' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:420:in
block (2 levels) in each_strongly_connected_component_from' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:429:in
each_strongly_connected_component_from' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:419:in
block in each_strongly_connected_component_from' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:44:in
each' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:44:in
tsort_each_child' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:413:in
call' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:413:in
each_strongly_connected_component_from' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:347:in
block in each_strongly_connected_component' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in
each' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in
call' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:345:in
each_strongly_connected_component' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:224:in
tsort_each' from
/Users/Tony/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/tsort.rb:203:in
tsort_each' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/initializable.rb:54:in
run_initializers' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/application.rb:352:in
initialize!' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/config/environment.rb:5:in
' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/config.ru:3:in
require' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/config.ru:3:in
block in ' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in
instance_eval' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:55:in
initialize' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/config.ru:in
new' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/config.ru:in
' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in
eval' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:49:in
new_from_string' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/builder.rb:40:in
parse_file' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:299:in
build_app_and_options_from_config' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:208:in
app' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:61:in
app' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:336:in
wrapped_app' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:139:in
log_to_stdout' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/server.rb:78:in
start' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in
block in server' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in
tap' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in
server' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in
run_command!' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands.rb:17:in
' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/bin/rails:9:in
require' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/bin/rails:9:in
' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in
load' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in
call' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/client/command.rb:7:in
call' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/client.rb:28:in
run' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/bin/spring:49:in
<top (required)>' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/binstub.rb:11:in
load' from
/Users/Tony/.rvm/gems/ruby-2.2.1/gems/spring-1.6.4/lib/spring/binstub.rb:11:in
<top (required)>' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/bin/spring:13:in
require' from
/Users/Tony/Desktop/Corner_Stone/vagrant/src/cornerstone/bin/spring:13:in
<top (required)>' from bin/rails:3:inload' from bin/rails:3:in
`'
Everything works when I remove the code in the mail_form.rb file, but I want to customize the mail notification to my liking. The error says undefined method template_root=' for MailForm::Notifier:Class, but I don't know what it means. I'm still learning so this error is a little over my head, Any help would be greatly appreciated! Thanks!
I was faced with the same problem. It was quite frustrating that their documentation is lacking information about custom template. It's so nebulous. I need to give credit to a colleague of mine for finding a quick solution. He is way more skilled than me in Ruby.
Here's what he did:
Remove/delete the mail_form.rb file in initializers. My colleague thinks the gem already does this by default, and after testing this theory I guess he was right. So you don't need the file.
Expend your External Libraries folder in your project tree and find the mail_form folder. I'm using RubyMine so I don't know if your software will show this. tell me if if it doesn't and I will update my answer and paste the initial template code.
Inside the mail_form folder, expand and access the following file lib>mail_form>views>mail_form>contact.erb. This .erb file is the initial template used by the gem.
Copy/paste the content of the file accessed above into the contact.erb file that you previously created inside your mail_form directory in your views directory. This will become your custom template.
Once this is done, you now have full control over the email template, so modify the code to your liking.

undefined local variable or method `count_notification' for #Spec::Runner::TeamcityFormatter

Upgraded to latest rubymine 6.3 and while trying to run all the specs using spec configuration coming across the issue. Looking at the logs looks like a rubymine issue. Any idea how to fix this issue?
/Applications/RubyMine.app/rb/testing/patch/bdd/teamcity/spec/runner/formatter/teamcity/rspec3_formatter.rb:250:in `dump_summary': undefined local variable or method `count_notification' for #<Spec::Runner::Formatter::TeamcityFormatter:0x007f8d338fd3e8> (NameError)
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/reporter.rb:134:in `block in notify'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/reporter.rb:133:in `each'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/reporter.rb:133:in `notify'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/reporter.rb:116:in `finish'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/reporter.rb:55:in `ensure in report'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/reporter.rb:55:in `report'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:107:in `run_specs'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:85:in `run'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69:in `run'
from /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37:in `invoke'
from /Users/ac027466/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/exe/rspec:4:in `<main>'
/Users/xxxxx/.rvm/rubies/ruby-2.1.3/bin/ruby -I/Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/lib:/Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-support-3.1.2/lib /Users/xxxxx/.rvm/gems/ruby-2.1.3/gems/rspec-core-3.1.7/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
Updating to rubymine 6.3.3 fixed the issue for me.

Cap aborted SSHKit error

I am trying to deploy my rails app with capistrano and I am getting the following error after the command:
cap production deploy
Output:
DEBUG[a3e9636c] Running /usr/bin/env [ -d ~/.rvm ] on handco-op.com
DEBUG[a3e9636c] Command: [ -d ~/.rvm ]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host appname.com: Authentication failed for user deploy#appname.com
/home/deploy/.rvm/gems/ruby-2.1.2/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:179:in `with_ssh'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:62:in `test'
/home/deploy/.rvm/gems/ruby-2.1.2/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:19:in `block (3 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Net::SSH::AuthenticationFailed: Authentication failed for user deploy#appname.com
/home/deploy/.rvm/gems/ruby-2.1.2/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:179:in `with_ssh'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:62:in `test'
/home/deploy/.rvm/gems/ruby-2.1.2/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:19:in `block (3 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => rvm:hook
(See full trace by running task with --trace)
Just to be clear, I replaced my real server name with "appname" to stay secret;) Thanks for any advice! I hope it is a simple fix and I will keep looking into the error as well.
I was missing secret keys, had to set up nopassword ssh and a lot of other tweaks. It is a hard error to fix and takes a lot of things to get around. It was about three hours of debugging and fixing my permissions. Some tutorials setting this up actually can mess things up such as setting the users in the sudo group really makes it hard to define the user directly in: visudo I recommend not adding anything to the sudo group via:
sudo adduser user sudo
This was just my set up so you may need to add a user to sudo but I prefer giving ALL permissions to my users in visudo with:
visudo
user ALL = NOPASSWD:
Hope this someone get around this! it was a dang hard error to fix with a lot happening and was mostly my user errors when configuring capistrano. Good luck! Keep calm and code on!;)

NoMethodError on Rails Vulcanize with Rubber

I am very new to rails and am trying to get my app setup via rubber. I was able to get a test app up without issue but am running into some sort of error when actually trying to vulcanize my built app. Tried to search high and low to no avail. Anyone have any idea what I need to do to get rid of the issue? Much appreciated.
localhost:thiswins markhayden$ rubber vulcanize complete_passenger_nginx_mysql
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rubber-2.2.4/lib/rubber/commands/vulcanize.rb:53:in `block in <class:Vulcanize>': undefined method `-' for "complete_passenger_nginx_mysql":String (NoMethodError)
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/attribute/declaration.rb:33:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/attribute/declaration.rb:33:in `block in define_writer_for'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/parameter/parsing.rb:13:in `block (2 levels) in parse_parameters'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/parameter/parsing.rb:12:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/parameter/parsing.rb:12:in `block in parse_parameters'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/parameter/parsing.rb:10:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/parameter/parsing.rb:10:in `parse_parameters'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/command.rb:55:in `parse'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/command.rb:68:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/subcommand/execution.rb:11:in `execute'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/command.rb:69:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/clamp-0.6.0/lib/clamp/command.rb:127:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rubber-2.2.4/bin/rubber:17:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/rubber:19:in `load'
from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/rubber:19:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
We had this same problem with:
rubber vulcanize complete_passenger_postgresql
It seems to be an error in the gem at rubber/commands/vulcanize.rb on Line 53 because it tries to subtract an array from a string which is illegal. I changed it to (as sudo):
invalid = (arg.kind_of?(String) ? [arg] : arg) - VulcanizeThor.valid_templates
This allowed setup however I am not sure if the vulcanization did more than it was supposed to have because I am also new to Rubber. This was a drastic measure so be careful by trying it on a non-production environment first!

Resources