I have installed ruby and rails and my application gives me an error when I am trying to run
rake db:migrate
this is the result of the command rake db:migrate --trace
** Execute db:migrate
rake aborted!
!!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/mysql_adapter.rb:22:in `rescue in mysql_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/mysql_adapter.rb:19:in `mysql_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `checkout_new_connection'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:191:in `block (2 levels) in checkout'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `loop'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `block in checkout'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `checkout'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:94:in `connection'
/usr/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:83:in `select_connection'
/usr/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:177:in `send_queries_to_selected_slave'
/usr/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:140:in `method_missing'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:454:in `get_all_versions'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:583:in `migrated'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:492:in `current_version'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `block in migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `each'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `detect'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:509:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:433:in `up'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/migration.rb:415:in `migrate'
/usr/lib/ruby/gems/1.9.1/gems/activerecord-3.0.6/lib/active_record/railties/databases.rake:142:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/bin/rake:19:in `load'
/usr/bin/rake:19:in `<main>'
confiz#confiz-desktop:~/mango_apps/rails_app_sms$ .
bash: .: filename argument required
.: usage: . filename [arguments]
I have already mentioned gem in my gemfile and already executed bundle install.
My database.yml file already has the correct adapter i.e. adapter: mysql2
Please help me resolve this problem.
I find the same problem if I use mysql2 v 0.2.19b4 in my Gemfile. If I use the latest mysql2 this conflicts with rails 3.0.17 which is dictated by Hobo (which generated my Gemfile). The warning I get from that is:
This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1. Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
Going back to mysql2 v 0.2.x The original load error comes because the rails mysql_adapter calls require 'mysql' not require 'mysql2'.
The solution is to use gem 'mysql' not gem 'mysql2' in the Gemfile
In my case bundler users gem mysql v 2.8.1 and everything works fine.
Related
I started to upgrade Rails 4.0 app to Rails 4.1. App uses a lot of gems and Thinking Sphinx is one of them. I have reinstalled thinking-sphinx gem after Rails 4.1 upgrade (to enable proper version of joiner, which is 3.0 now). But now I get weird error from TS when I try, for example, to rebuild index:
$ rake ts:rebuild --trace
** Invoke ts:rebuild (first_time)
** Invoke ts:stop (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute ts:stop
searchd is not currently running.
Stopped searchd daemon (pid: ).
** Invoke ts:index (first_time)
** Invoke environment
** Execute ts:index
Generating configuration to /Users/serj/Projects/project/config/development.sphinx.conf
rake aborted!
NoMethodError: undefined method `parent' for #<ActiveRecord::Associations::JoinDependency::JoinAssociation:0x007ff438543678>
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/filtered_reflection.rb:40:in `block in scope'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:52:in `instance_exec'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:52:in `block (2 levels) in join_constraints'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:48:in `map'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:48:in `block in join_constraints'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:33:in `reverse_each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency/join_association.rb:33:in `join_constraints'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:161:in `make_constraints'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:167:in `make_outer_joins'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `block in make_outer_joins'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `flat_map'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:169:in `make_outer_joins'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `block in walk'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `flat_map'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:205:in `walk'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:114:in `block in join_constraints'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:112:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:112:in `flat_map'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/associations/join_dependency.rb:112:in `join_constraints'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/relation/query_methods.rb:985:in `build_joins'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/relation/query_methods.rb:838:in `build_arel'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/relation/query_methods.rb:830:in `arel'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/activerecord-4.1.1/lib/active_record/relation.rb:520:in `to_sql'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_builder.rb:11:in `sql_query'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_source.rb:119:in `build_sql_query'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_source.rb:136:in `prepare_for_render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/sql_source.rb:65:in `render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/riddle-1.5.11/lib/riddle/configuration/index.rb:29:in `block in render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/riddle-1.5.11/lib/riddle/configuration/index.rb:29:in `collect'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/riddle-1.5.11/lib/riddle/configuration/index.rb:29:in `render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/core/index.rb:53:in `render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/riddle-1.5.11/lib/riddle/configuration.rb:43:in `block in render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/riddle-1.5.11/lib/riddle/configuration.rb:43:in `collect'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/riddle-1.5.11/lib/riddle/configuration.rb:43:in `render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/configuration.rb:90:in `render'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/configuration.rb:96:in `block in render_to_file'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/open-uri.rb:36:in `open'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/open-uri.rb:36:in `open'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/configuration.rb:96:in `render_to_file'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/rake_interface.rb:13:in `configure'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/rake_interface.rb:24:in `index'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/tasks.rb:9:in `block (2 levels) in <top (required)>'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:201:in `block in invoke_prerequisites'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:199:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:199:in `invoke_prerequisites'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:178:in `block in invoke_with_call_chain'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/bin/rake:23:in `load'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/bin/rake:23:in `<main>'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/bin/ruby_executable_hooks:15:in `eval'
/Users/serj/.rvm/gems/ruby-2.0.0-p353#project/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => ts:rebuild => ts:index
Gemfile
source 'http://rubygems.org'
gem 'rails', '4.1.0'
# Sphinx.
gem 'mysql2', '0.3.13', platform: :ruby
gem 'thinking-sphinx', '~> 3.1.1'
# ...
thinking_sphinx.yml
development: &defaults
morphology: stem_enru, Soundex, Metaphone
enable_star: 1
expand_keywords: 1
min_infix_len: 2
max_matches: 500000
test:
mysql41: <%= ENV['TEST_ENV_NUMBER'].to_i + 9307 %>
pid_file: <%= File.join(Rails.root, "tmp", "searchd.#{ENV['TEST_ENV_NUMBER']}.pid") %>
indices_location: <%= File.join(Rails.root, "db", "sphinx", "#{ENV['TEST_ENV_NUMBER']}") %>
configuration_file: <%= File.join(Rails.root, "config", "test.#{ENV['TEST_ENV_NUMBER']}.sphinx.conf") %>
binlog_path: <%= File.join(Rails.root, "db", "sphinx", "#{ENV['TEST_ENV_NUMBER']}", "binlog") %>
<<: *defaults
Additional data:
Rails 4.1
Sphinx 2.1.4-release (rel21-r4421)
thinking-sphinx 3.1.1
mysql2 0.3.16 (for sphinx)
pg 0.17.1 (it's my main database)
Any ideas how to deal with that? I can't make the upgrade to new Rails, because the project uses TS very heavy.
Okey, there is the problem with Thinking Sphinx and Rails 4.1. Polymorphic associations are broken in Thinking Sphinx, when you use Rails 4.1 (because, well, a lot of things changed in ActiveRecord). Here is the issue, which I opened: https://github.com/pat/thinking-sphinx/issues/783
In my case I just moved from polymorphic association, because I wanted to be able to completely upgrade to Rails 4.1.
UPD: Pat fixed the issue, it should work now.
I have redmine site:
Environment:
Redmine version 2.3.3.devel
Ruby version 1.9.3-p448 (2013-06-27) [x86_64-linux]
Rails version 3.2.13
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.11
Git 1.7.1
Filesystem
Redmine plugins:
redmine_contacts 3.2.2-light
redmine_contacts_invoices 2.1.0-light
redmine_favorite_projects 1.0.0
redmine_finance 1.0.1-light
redmine_issue_checklist 2.0.5
redmine_people 0.1.6
redmine_questions 0.0.4
I updated ruby and redmine, receiving mail not working (it worked before)
/usr/bin/rake -f /var/www/html/redmine/Rakefile --silent redmine:email:receive_pop3 RAILS_ENV="production" host=mail.my.site username=redmine#my.site password=mypassword delete_unprocessed=1 --trace
Your FCGI gem does not contain the FCGI shared library, running pure ruby instead
** Invoke redmine:email:receive_pop3 (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:email:receive_pop3
rake aborted!
"\xCE" from ASCII-8BIT to UTF-8
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/fields/unstructured_field.rb:149:in `encode!'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/fields/unstructured_field.rb:149:in `fold'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/fields/unstructured_field.rb:103:in `wrapped_value'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/fields/unstructured_field.rb:69:in `do_encode'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/fields/unstructured_field.rb:51:in `encoded'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/field.rb:167:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/header.rb:206:in `block in encoded'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/header.rb:205:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/header.rb:205:in `encoded'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/mail-2.5.4/lib/mail/message.rb:1801:in `encoded'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionmailer-3.2.13/lib/action_mailer/base.rb:434:in `set_payload_for_mail'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionmailer-3.2.13/lib/action_mailer/base.rb:403:in `block in receive'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in `block in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/actionmailer-3.2.13/lib/action_mailer/base.rb:401:in `receive'
/var/www/html/redmine/app/models/mail_handler.rb:46:in `receive'
/var/www/html/redmine/lib/redmine/pop3.rb:39:in `block (2 levels) in check'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/pop.rb:665:in `each'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/pop.rb:665:in `each_mail'
/var/www/html/redmine/lib/redmine/pop3.rb:36:in `block in check'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/pop.rb:533:in `start'
/var/www/html/redmine/lib/redmine/pop3.rb:31:in `check'
/var/www/html/redmine/lib/tasks/email.rake:152:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => redmine:email:receive_pop3
please help somebody
I had the same error when a non-MIME-compliant message was received: the Subject line included a non-ASCII character.
Upgrade to Redmine 2.6. That should solve the problem.
When I try and run a RAKE on Webistrano I get the following error:
undefined method `name' for "actionmailer":String`
I am a not proficient in Ruby and RoR but I have installed and played about with plenty of applications before and I can't find what the issue is.
The command I am running is:
RAILS_ENV=production rake db:migrate --trace
Which produces the below:
I would really like to know the best way to diagnose and fix this issue and issues like it in the future.
(in /srv/www/webistrano)
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `name' for "actionmailer":String
/srv/www/webistrano/vendor/rails/railties/lib/rails/gem_dependency.rb:268:in `=='
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `==='
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:217:in `block in matching_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:411:in `block in each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:410:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `find_all'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:216:in `matching_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:238:in `to_specs'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
/srv/www/webistrano/vendor/rails/railties/lib/rails/gem_dependency.rb:73:in `add_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `block in add_gem_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `each'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:301:in `add_gem_load_paths'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:132:in `process'
/srv/www/webistrano/vendor/rails/railties/lib/initializer.rb:113:in `run'
/srv/www/webistrano/config/environment.rb:16:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `block in require'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/srv/www/webistrano/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/srv/www/webistrano/vendor/rails/railties/lib/tasks/misc.rake:4:in `block in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:190:in `mon_synchronize'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate => environment
When I run ruby -v I get the following:
ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]
I had this problem.
The solution is to downgrade rubygems to a version you support.
I needed version 1.3.5 (for rails 2.3.5)
So you need to do:
gem install rubygems-update -v 1.3.5
update_rubygems --version=1.3.5
And now rake should work.
This worked for me.
rvm rubygems 1.6.2
I have upgraded to rails 2.3.11 and and ruby 1.9.2 as some of my gems were incompatible with previous version. Now I am unable to execute rake command. I am getting following error when i do rake gems:install or rake db:migrate.
(in C:/Ruby/New/Facebook)
rake aborted!
can't convert Symbol into Integer
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53:
in `[]'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53:
in `initialize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:836:in `new'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:836:in `gem'
C:/Ruby/New/Facebook/config/environment.rb:22:in `block in <top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:111:in `run'
C:/Ruby/New/Facebook/config/environment.rb:9:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe
ndencies.rb:182:in `block in require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe
ndencies.rb:547:in `new_constants_in'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe
ndencies.rb:182:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/tasks/misc.rake:4:in `block
in <top (required)>'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
C:/Ruby192/bin/rake:31:in `<main>'
Please help me as I am stuck on it for few days.
Looks like a Rake version issue to me. Try this...
gem uninstall rake # select all options
gem 'rake', '0.8.7' # Gemfile
bundle install
run you rake command
Placing this line of code in your .rvmrc in your root directory will allow you to skip little error like this in the future.
bundle exec $SHELL
All the best, let us know how you get on.
It's possible that you need to upgrade rubygems-update.
Run gem -v to see your current version number.
Run gem update --system to upgrade rubygems. (you may need to sudo depending on your setup)
To revert to your previous version, run gem update --system 1.3.7 (swap 1.3.7 for the previous version number)
You are suppose to resolve the conflicts of gems befre initiate rake. try running server if you get succeeded it means you can run Rake as well it has nothing to do with Rake version befre running rake make a valid gem list for rails.
On a new machine, installed ruby with the 1-click installer for windows. Installed rails 2.3.2 and all associated gems, then I installed the sqlite3 binaries (into the c:\ruby\bin folder). Lastly I did gem install sqlite3-ruby -v=1.2.3 (which is apparently the latest version that works with windows)
This error happens when I run rake db:migrate or when any ActiveRecord object is touched at runtime.
The error looks like this:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
**uninitialized constant Encoding** <----
Any help resolving this error would be greatly appreciated!
Trace:
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/encoding.rb:9:in `find'
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/database.rb:69:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:13:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:13:in `sqlite3_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:435:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:400:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:400:in `up'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/migration.rb:383:in `migrate'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/databases.rake:116
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 `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 `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:583: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:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068: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:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/Ruby/bin/rake:19:in `load'
C:/Ruby/bin/rake:19
If you look at the backtrace will noticed that the issue is not sqlite3-ruby but another gem you have installed:
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/encoding.rb:9:in `find'
C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-0.0.3/lib/sqlite3/database.rb:69:in `initialize'
Please uninstall sqlite3 gem (gem uninstall sqlite3) since seems interfering with the loading mechanism.
The sqlite3-ruby gem version 1.2.5 has been updated for Windows and should work out of the box.
I recommend reading the tutorials of the new RubyInstaller that replaces One-Click:
Tutorials
And also install latest RC1 version, instead of One-Click from here
Hope this helps.