Fog creating spot request fails - ruby

Here's the paramters I'm passing to connection.spot_requests.create().
{:price=>"1", :image_id=>"ami-63be790a", :groups=>["mcsl-web", "default"], :flavor_id=>"m1.xlarge", :key_name=>"mcsl", :availability_zone=>"us-east-1a", :block_device_mapping=>[{"DeviceName"=>"/dev/sda1", "Ebs.VolumeSize"=>"8", "Ebs.DeleteOnTermination"=>"true"}]}
Here's the error:
/Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/compute/parsers/aws/spot_instance_requests.rb:37:in `[]=': can't convert String into Integer (Excon::Errors::SocketError)
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/compute/parsers/aws/spot_instance_requests.rb:37:in `end_element'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/nokogiri-1.5.0/lib/nokogiri/xml/sax/document.rb:127:in `end_element_namespace'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/nokogiri-1.5.0/lib/nokogiri/xml/sax/push_parser.rb:47:in `native_write'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/nokogiri-1.5.0/lib/nokogiri/xml/sax/push_parser.rb:47:in `write'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/core/connection.rb:16:in `block in request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/excon-0.6.6/lib/excon/response.rb:46:in `parse'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/excon-0.6.6/lib/excon/connection.rb:174:in `request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/core/connection.rb:20:in `request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/compute/aws.rb:280:in `request'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/compute/requests/aws/request_spot_instances.rb:77:in `request_spot_instances'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/compute/models/aws/spot_request.rb:76:in `save'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180#global/gems/fog-0.11.0/lib/fog/core/collection.rb:50:in `create'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/knife-ec2-0.5.6/lib/chef/knife/ec2_server_create.rb:259:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/lib/chef/knife.rb:391:in `run_with_pretty_exceptions'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/lib/chef/knife.rb:166:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/lib/chef/application/knife.rb:128:in `run'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/gems/chef-0.10.4/bin/knife:25:in `<top (required)>'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bin/knife:19:in `load'
from /Users/wedtm/.rvm/gems/ruby-1.9.2-p180/bin/knife:19:in `<main>'

This is a bug in fog. I just ran into it myself and wrote a quick patch. You can find my patch at https://github.com/geemus/fog/pull/553

Related

`auth_data=': couldn't set additional authenticated data (OpenSSL::Cipher::CipherError)

trying to create a new project on RoR and i get this error:
/Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.6.1/lib/active_support/message_encryptor.rb:170:in `auth_data=': couldn't set additional authenticated data (OpenSSL::Cipher::CipherError)
from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.6.1/lib/active_support/message_encryptor.rb:170:in `_encrypt'
from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.6.1/lib/active_support/message_encryptor.rb:148:in `encrypt_and_sign'
from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.6.1/lib/active_support/encrypted_file.rb:88:in `encrypt'
from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.6.1/lib/active_support/encrypted_file.rb:61:in `write'
from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.6.1/lib/active_support/encrypted_configuration.rb:29:in `write'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/generators/rails/credentials/credentials_generator.rb:30:in `add_credentials_file_silently'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/generators/rails/app/app_generator.rb:194:in `credentials'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/generators/app_base.rb:165:in `public_send'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/generators/app_base.rb:165:in `build'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/generators/rails/app/app_generator.rb:386:in `create_credentials'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `block in invoke_all'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `each'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `map'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `invoke_all'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/group.rb:232:in `dispatch'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/commands/application/application_command.rb:26:in `perform'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/command/base.rb:69:in `perform'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/command.rb:48:in `invoke'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/lib/rails/cli.rb:18:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:65:in `require'
from /Users/carolinecagnin/.gem/ruby/2.6.0/gems/railties-6.1.6.1/exe/rails:10:in `<top (required)>'
from /usr/bin/rails:22:in `load'
from /usr/bin/rails:22:in `<main>'
Tried almost everything i found on internet and still can't solve it... I'm just trying to study lol I also use mac OS Monterey

Web application could not be started undefined method

When I installed redmine-3.3 & 3.4 , I am not getting redmine page
I am facing this Error
Web application could not be started
undefined method `require_sudo_mode' for EmailAddressesController:Class (NoMethodError)
/usr/share/redmine/app/controllers/email_addresses_controller.rb:21:in `<class:EmailAddressesController>'
/usr/share/redmine/app/controllers/email_addresses_controller.rb:18:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `block in require'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:in `load_dependency'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:359:in `require_or_load'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:313:in `depend_on'
/usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:225:in `require_dependency'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:444:in `block (2 levels) in eager_load!'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:443:in `each'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:443:in `block in eager_load!'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:441:in `each'
/usr/lib/ruby/vendor_ruby/rails/engine.rb:441:in `eager_load!'
/usr/lib/ruby/vendor_ruby/rails/application/finisher.rb:53:in `block in <module:Finisher>'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `instance_exec'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in `run'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in `block in run_initializers'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `each'
/usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in `run_initializers'
/usr/lib/ruby/vendor_ruby/rails/application.rb:136:in `initialize!'
/usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:in `method_missing'
/usr/share/redmine/config/environment.rb:14:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `instance_eval'
/usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
Application root /usr/share/redmine Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV and PASSENGER_ENV) production Ruby interpreter
command /usr/bin/ruby.. .... ..
Can you give me suggestions?
Please ensure you'r connected with your database and did you missing any required gem.
require_sudo_mode. If the error comes because of this you definitely missing this gem.
This type of error comes under database not connected issue.If you are fix that this would be start.Thanks..!

RHC setup gives mkdir error

I am trying to add an openshift origin server for the first time. using :
rhc setup --server my.server.adr
but I get this error when it comes to Generate the token.
Generating an authorization token for this client ... C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:252:in `mkdir': No such file or directory #dir_s_mkdr - U: (Errno::ENOENT)
from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:252:in `fu_mkdir'
from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:226:in `block (2 levels) in mkdir_p'
from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:224:in `reverse_each'
from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:224:in `block in mkdir_p'
from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:210:in `each'
from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:210:in `mkdir_p'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/auth/token_store.rb:34:in `[]='
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/auth/token_store.rb:14:in `put'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/auth/token.rb:50:in `save'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/wizard.rb:243:in `block in login_stage'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/highline_extensions.rb:190:in `call'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/highline_extensions.rb:190:in `section'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/highline_extensions.rb:204:in `paragraph'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/helpers.rb:337:in `block (2 levels) in <module:Helpers>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/wizard.rb:237:in `login_stage'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/wizard.rb:67:in `block in run'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/wizard.rb:65:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/wizard.rb:65:in `run'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/commands/setup.rb:57:in `run'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/commands.rb:294:in `execute'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/commands.rb:285:in `block (3 levels) in to_commander'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/commander-4.2.1/lib/commander/command.rb:155:in `run'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/commander-4.2.1/lib/commander/runner.rb:421:in `run_active_command'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/command_runner.rb:72:in `run!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/lib/rhc/cli.rb:37:in `start'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.3/bin/rhc:20:in `<top (required)>'
from C:/Ruby22-x64/bin/rhc:23:in `load'
from C:/Ruby22-x64/bin/rhc:23:in `<main>'
I can't find what's wrong, and what is the - U: after #dir_s_mkdir ?
any help or hint would be apreciated.
Thank you for your answers, I think it's a compatibility problem as you said with ruby 2.2
I didn't use another ruby version but I used a docker container instead.

Mysql2::Error: Access denied for user 'swapnasa'#'localhost' (using password: NO) (Sequel::DatabaseConnectionError)

I trying to conect a Ruby application to MySQL databases. Every time I get the below error:
/home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Mysql2::Error: Access denied for user 'swapnasa'#'localhost' (using password: NO) (Sequel::DatabaseConnectionError)
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/adapters/mysql2.rb:34:in `new'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/adapters/mysql2.rb:34:in `connect'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool.rb:94:in `make_new'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:158:in `make_new'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:137:in `available'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:127:in `block in acquire'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:194:in `block in sync'
from <internal:prelude>:10:in `synchronize'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:194:in `sync'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:126:in `acquire'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/connection_pool/threaded.rb:94:in `hold'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/database/connecting.rb:235:in `synchronize'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/adapters/shared/mysql_prepared_statements.rb:34:in `execute'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/dataset/actions.rb:860:in `execute'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/adapters/mysql2.rb:159:in `execute'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/adapters/mysql2.rb:137:in `fetch_rows'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/dataset/actions.rb:156:in `each'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/dataset/actions.rb:437:in `map'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/dataset/actions.rb:437:in `map'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/adapters/shared/mysql.rb:451:in `schema_parse_table'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/database/query.rb:197:in `schema'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model/base.rb:795:in `block in get_db_schema'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model/base.rb:719:in `check_non_connection_error'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model/base.rb:795:in `get_db_schema'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model/base.rb:572:in `block in set_dataset'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model/base.rb:719:in `check_non_connection_error'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model/base.rb:572:in `set_dataset'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/sequel-3.48.0/lib/sequel/model.rb:46:in `Model'
from /home/swapnasa/Downloads/irclogger-master/lib/irclogger/message.rb:3:in `<top (required)>'
from /home/swapnasa/Downloads/irclogger-master/lib/irclogger.rb:8:in `require'
from /home/swapnasa/Downloads/irclogger-master/lib/irclogger.rb:8:in `<top (required)>'
from viewer.ru:3:in `require'
from viewer.ru:3:in `block in <main>'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from viewer.ru:1:in `new'
from viewer.ru:1:in `<main>'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/bin/thin:19:in `load'
from /home/swapnasa/.rvm/gems/ruby-1.9.3-p448/bin/thin:19:in `<main>'
Note that I have granted swapnasa#localhost access to the database. Still I am getting this error. What am I doing wrong?

Issue in using Twitter API from Ruby

I am new bee to twitter API and MongoDb. I am trying out a ruby example from the book 'MongoDb In Action', Chapter-3 which connects to Twitter and gets feeds based on given tags. I have done the ruby set up as suggested. I am getting the following exception, which I think is related to ruby set up. Any hint is highly appreciated.
/usr/lib/ruby/1.9.1/net/http.rb:762:in `initialize': execution expired (Twitter::Error::ClientError)
from /usr/lib/ruby/1.9.1/net/http.rb:762:in `open'
from /usr/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
from /usr/lib/ruby/1.9.1/net/http.rb:762:in `connect'
from /usr/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from /usr/lib/ruby/1.9.1/net/http.rb:744:in `start'
from /usr/lib/ruby/1.9.1/net/http.rb:1284:in `request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:75:in `perform_request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:38:in `call'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/response.rb:8:in `call'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/response.rb:8:in `call'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/response.rb:8:in `call'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/request/url_encoded.rb:14:in `call'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/request/multipart.rb:13:in `call'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/request/multipart_with_file.rb:14:in `call'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:247:in `run_request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:112:in `post'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/client.rb:108:in `request'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/client.rb:72:in `post'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/api/utils.rb:82:in `object_from_response'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/api/oauth.rb:24:in `token'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/client.rb:96:in `block in request_setup'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:102:in `block in get'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:243:in `block in run_request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:258:in `block in build_request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/request.rb:35:in `block in create'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/request.rb:34:in `tap'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/request.rb:34:in `create'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:254:in `build_request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:239:in `run_request'
from /var/lib/gems/1.9.1/gems/faraday-0.8.7/lib/faraday/connection.rb:100:in `get'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/client.rb:108:in `request'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/client.rb:66:in `get'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/api/utils.rb:82:in `object_from_response'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter/api/search.rb:32:in `search'
from /var/lib/gems/1.9.1/gems/twitter-4.8.1/lib/twitter.rb:60:in `method_missing'
from /home/hadoop/archiver.rb:27:in `save_tweets_for'
from /home/hadoop/archiver.rb:21:in `update'
from update.rb:5:in `block in <main>'
from update.rb:3:in `each'
from update.rb:3:in `<main>'
The book you are reading was printed in 2011 and appears to use APIv1 which has recently been depreciated by twitter.
https://dev.twitter.com/docs/faq#17750
You'll need to set up oauth and I suggest you start with the twitter gem documentation.
https://github.com/sferik/twitter

Resources