Why does this Albacore msbuild task fail in TeamCity? - msbuild

I have an msbuild task which builds an asp.net application
msbuild :build do |msb|
puts "Running local build"
msb.properties :configuration => :Release, :outdir => File.dirname(__FILE__) + "/output/"
msb.targets :Build
msb.solution = 'App.sln'
msb.verbosity = 'quiet'
end
Running this locally works perfectly fine however when Teamcity (5.1.2, build 13430) try's to build it, it fails with the following error:
[18:13:04]: C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/albacore/support/attrmethods.rb:7: warning: parenthesize argument(s) for future version
[18:13:04]: C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/albacore/support/attrmethods.rb:7: warning: parenthesize argument(s) for future version
[18:13:05]: Execute build
[18:13:05]: [Execute build]
RuntimeError: MSBuild Failed. See Build Log For Detail
Stacktrace:
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/albacore/support/failure.rb:12:in `fail_with_message'
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/albacore/msbuild.rb:41:in `build_solution'
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/albacore/msbuild.rb:26:in `build'
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/rake/msbuildtask.rb:2
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/rake/support/createtask.rb:17:in `call'
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/rake/support/createtask.rb:17:in `execute'
C:/ruby/lib/ruby/gems/1.8/gems/albacore-0.1.5/lib/rake/support/albacoretask.rb:16:in `define'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `standard_execute'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `standard_execute'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:260:in `execute'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:266:in `execute'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
C:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
C:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
C:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `standard_invoke_with_call_chain'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:235:in `invoke'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:90:in `target_exception_handling'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:234:in `invoke'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:311:in `standard_exception_handling'
C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rake_ext.rb:179:in `run'
C:/TeamCity/buildAgent/plugins/rake-runner/lib/rb/runner/rakerunner.rb:40
When I try running the rake script from the build agent's folder the build script completes successfully. The only thought I have is that msbuild outputs this warning:
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.

Turns out, I needed to state the full path to the solution
root_path = File.dirname(__FILE__)
msbuild :build do |msb|
puts "Running local build"
msb.properties :configuration => :Release, :outdir => File.dirname(__FILE__) + "/output/"
msb.targets :Build
msb.solution = File.join(root_path, 'App.sln')
msb.verbosity = 'quiet'
end

you can add this to msbuild to get the proper msbuild output:
/l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,D:/teamcity/buildagent/plugins/dotnetplugin/bin/JetBrains.BuildServer.MSBuildLoggers.dll
Edit: In albacore-speak:
msb.parameters "/l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,D:/teamcity/buildagent/plugins/dotnetplugin/bin/JetBrains.BuildServer.MSBuildLoggers.dll"
(set it to your TC path obviously)
Edit 2: The MSBuild error sounds like you're referencing different version of things. have you got strongly named references? Did you let resharper add your references? sometimes it mixes them up, adding references to other project's bin folders instead of your lib.

Related

Rake command not working while trying to read email from gmail server using IMAP

I am running below rake command to read email using IMAP from use_redmine.bat
in which my working directory is \Bitnami\redmine-3.3.3-1\apps\redmine\htdocs>
and the command is
rake redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com \
port=993 username=xxxx password=xxxx ssl=1 tracker=feature unknown_user=accept \
allow_override=all --trace
Note:
It is working in my local system and I am successfully able to create feature and bug from email conduit. But not working on the server(another system).
Things I have tried:
Disabled firewall on the server in case if it is blocking.
Disabled antivirus on the server in case if it is blocking.
Installed the same setup in both machine local and the server.
Installed the same setup with the same windows version.
Followed the same setup steps in both machine local and the server like.
-Installing bitnami-redmine-3.3.3-1-windows-installer.exe.
-running bundle install.
-running bundle install --no-deployment.
-running rake command.
Also, have checked that port is listening by net sh command.
**Output of the command:**
** Invoke redmine:email:receive_imap (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_imap
rake aborted!
OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/net/imap.rb:1492:in `connect'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/net/imap.rb:1492:in `start_tls_session'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/net/imap.rb:1085:in `initialize'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/redmine/imap.rb:30:in `new'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/redmine/imap.rb:30:in `check'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/tasks/email.rake:117:in `block (4 levels) in <top (required)>'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/app/models/mailer.rb:430:in `with_synched_deliveries'
C:/Bitnami/redmine-3.3.3-1/apps/redmine/htdocs/lib/tasks/email.rake:116:in `block (3 levels) in <top (required)>'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Bitnami/redmine-3.3.3-1/ruby/lib/ruby/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Bitnami/redmine-3.3.3-1/ruby/bin/rake:22:in `load'
C:/Bitnami/redmine-3.3.3-1/ruby/bin/rake:22:in `<main>'
Tasks: TOP => redmine:email:receive_imap
Any help is so much appreciated.!
If you are using Gmail as the outbound email server and you are not able to send email correctly, Google may be blocking sign-in attempts from your apps or devices. Depending on whether or not you use Google Apps, the steps to correct this will differ:
For Google Apps users
For other Google users

Ruby on Rails Tutorial Demo_App - rake db:migrate to Heroku not working

I'm doing Michael Hartl's Rails Tutorials and am having a bit of a problem with the final stage of the Demo App, that is, running the rake command on Heroku to migrate the database to the web.
The rake command with a --trace on it gives the following result:
$ heroku run rake db:migrate --trace
Running `rake db:migrate --trace` attached to terminal...
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36: command not found: tput cols
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36: command not found: tput lines
up, run.1
(in /app)
* Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
no such file to load -- pg
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `block in require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:227:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:9:in `postgresql_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `new_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:238:in `checkout_new_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:194:in `block (2 levels) in checkout'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `loop'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:190:in `block in checkout'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:189:in `checkout'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:96:in `connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:318:in `retrieve_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:486:in `initialize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in `new'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:433:in `up'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/migration.rb:415:in `migrate'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.0.1/lib/active_record/railties/databases.rake:142:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'
I thought that that 'command not found: tput' stuff at the start might have been down to something I modified (it looks like the word 'output' that got cut off) so I redid the entire chapter from the beginning, but ended up with the same result, so I don't think it's any changes I made to the code.
I'm using a Windows PC, running XP. Everything worked fine when run on the localhost and my Git Repository pushed to Heroku perfectly, so everything works except for this rake command. If ye want to see any of the other files, they're at: https://github.com/jimbobsweeney/demo_app
I'm very grateful in advance for any help on this. It's melting my brain.
Rob
Do you have Cygwin installed? This article (in Japanese) mentions this error and points to this SO question which suggests you make sure Cygwin and possibly ncurses is installed. A comment there links to this article which may also have useful information.
It looks like the issue is that heroku is looking for the tput command in your shell which is not available (which I believe comes with ncurses).
As for the stack trace, it looks like the pg gem is not in your Gemfile in a place the production environment will execute it. It's not necessary to install pg on Windows just to get the deploy working. Create a :production group in your Gemfile for this.
group :production do
gem "pg", "~> 0.11.0"
end
You can learn more about groups in the bundler docs.

Neither PUB key nor PRIV key:: nested asn1 error with apn_on_rails

I am trying to configure apn_on_rails to send push notifications from rails3 to iOS devices.
When I run bundle exec rake apn:notifications:deliver --trace
I get the following error:
(in /home/mari/Documents/descuentos)
** Invoke apn:notifications:deliver (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute apn:notifications:deliver
rake aborted!
Neither PUB key nor PRIV key:: nested asn1 error
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:52:in `initialize'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:52:in `new'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:52:in `open'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/libs/connection.rb:23:in `open_for_delivery'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/app/models/apn/notification.rb:104:in `send_notifications'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bundler/gems/apn_on_rails-18f5d37397e3/lib/apn_on_rails/tasks/apn.rake:7:in `block (3 levels) in <top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/mari/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/mari/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/mari/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => apn:notifications:deliver
I am running the application from ubuntu (can that cause the problem?). The person that is an agent in the apple developers program has generated the p12 and the pem twice for me from his computer following these instructions:
Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
Right click and choose Export 2 items….
Choose the p12 format from the drop down and name it cert.p12.
but I keep getting the error.
What can I do to fix it?
The certificate that was given to me was wrong. After generating the right certificate and p12 the problem was solved.

prawn undefined method headers

I'm trying to output my cucumber tests to pdf format. I've been doing this for a while and it's worked. After upgrading some gems my pdf output has stopped working with the error:
% rake cucumber:new_report_pdf
(in /home/map7/pais)
NOTICE: CREATE TABLE will create implicit sequence "employees_id_seq" for serial column "employees.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "employees_pkey" for table "employees"
NOTICE: CREATE TABLE will create implicit sequence "entities_id_seq" for serial column "entities.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "entities_pkey" for table "entities"
NOTICE: CREATE TABLE will create implicit sequence "ledgers_id_seq" for serial column "ledgers.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "ledgers_pkey" for table "ledgers"
NOTICE: CREATE TABLE will create implicit sequence "staff_id_seq" for serial column "staff.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "staff_pkey" for table "staff"
bundle exec /home/map7/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -I "/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib:lib" "/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/bin/cucumber" --profile new_report_pdf
Using the new_report_pdf profile...
..........undefined method `headers=' for #<Prawn::Table:0x0000000697d4d8> (NoMethodError)
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/prawn-0.11.1/lib/prawn/table.rb:124:in `block in initialize'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/prawn-0.11.1/lib/prawn/table.rb:124:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/prawn-0.11.1/lib/prawn/table.rb:124:in `initialize'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/prawn-0.11.1/lib/prawn/table.rb:25:in `new'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/prawn-0.11.1/lib/prawn/table.rb:25:in `table'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:240:in `print_table'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:161:in `block in before_multiline_arg'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:219:in `call'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:219:in `block in render'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:218:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:218:in `render'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:229:in `flush'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/formatter/pdf.rb:105:in `after_feature_element'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:174:in `block in send_to_all'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:172:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:172:in `send_to_all'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:165:in `broadcast'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:40:in `block in accept'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:39:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/feature.rb:39:in `accept'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:29:in `block in accept'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:17:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:17:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/features.rb:28:in `accept'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/runtime.rb:45:in `run!'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:43:in `execute!'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/lib/cucumber/cli/main.rb:20:in `execute'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-0.10.2/bin/cucumber:14:in `<main>'
rake aborted!
Command failed with status (1): [bundle exec /home/map7/.rvm/rubies/ruby-1....]
(See full trace by running task with --trace)
Here is my cucumber.yml file
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~#wip"
%>
default: <%= std_opts %> features
wip: --tags #wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~#wip
report: --format html --out=features.html
report_pdf: --format pdf --out=features.pdf
new: --tags #new
new_report: --format html --out=features_new.html --tags #new
new_report_pdf: --format pdf --out=features_new.pdf --tags #new
Do I have to upgrade cucumber? or downgrade prawn or something?
Update: I've tried using the latest cucumber & prawn git repo (24/05/2011) in my Gemfile and running bundle. I still get the same problem.
Update: (18/07/2011)
After following take_tk's advice and using
$ gem uninstall prawn --version=0.11.1
I got a little further but still have an issue:
..rake aborted!
Command failed with status (1): [/home/map7/.rvm/rubies/ruby-1.9.2-p180/bin...]
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-1.0.0/lib/cucumber/rake/task.rb:104:in `run'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-1.0.0/lib/cucumber/rake/task.rb:193:in `block in define_task'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/map7/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/map7/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/home/map7/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/home/map7/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
Tasks: TOP => cucumber:new_report_pdf
I have the same trouble. So, uninstalled "prawn --version=0.11.1". Then I got OK.
[tk#EeePC-31 kyuuyo]$ sudo gem list prawn*
* LOCAL GEMS *
prawn (0.11.1, 0.8.4) <<<-- version confused!
prawn-core (0.8.4)
prawn-layout (0.8.4)
prawn-security (0.8.4)
[tk#EeePC-31 kyuuyo]$ sudo gem uninstall prawn --version=0.11.1
Successfully uninstalled prawn-0.11.1
[tk#EeePC-31 kyuuyo]$ sudo gem list prawn*
* LOCAL GEMS *
prawn (0.8.4)
prawn-core (0.8.4)
prawn-layout (0.8.4)
prawn-security (0.8.4)

Issues implementing Rspec with Rails3 from tutorial

I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
I am trying to implement RSpec with Rails 3. I am using Rails 3.0.3 with Ruby 1.9.2 on Ubuntu 10.04 os. I am using rspec 2.5 gem and rspec-rails 2.5 gem.
I am referring to the following tutorial:-
http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework
This tutorial is implemented on Rails 2.x with an older version of rspec and rspec-rails.
I tried to implement exactly the same tutorial with my configuration, but I have run into some issues. I am unable to figure out what I must have done wrong.
I am sure about one thing that I am not using the rails_scaffold generator as used in this tutorial. Instead of using the rails_scaffold generator, I made use of the following command rails g scaffold post title:string body:text
I don't seem to have it(rspec_scaffold) in my list of generators which as part of Rails 3 and the additional ones that will come with Rspec.
The error I am getting is :-
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$ rake spec
(in /home/mohnish/rails_testing/10Mar11/rspec_demo5)
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
(See full trace by running task with --trace)
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$ rake spec --trace
(in /home/mohnish/rails_testing/10Mar11/rspec_demo5)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:429:in `block (3 levels) in <top (required)>'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:607:in `block in invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:596:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:460:in `block (3 levels) in <top (required)>'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:607:in `block in invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:596:in `block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$
Any suggestions on what I must be doing wrong and how to fix the same. Kindly help.
Thank you very much.
I made a fundamental mistake, I realized that I always made use of rake db:create, and rake db:migrate. This would set things for me with
Development Environment. For the test enviroment, I had to use rake db:test:prepare or rake db:migrate with appropriate syntax to reflect
the migrations in the Test Environment.