投稿

Ansible On Windows

Windows 環境で Ansible を利用できるようにするために、 C:\temp>pip install ansible Downloading/unpacking ansible   Running setup.py egg_info for package ansible     Traceback (most recent call last):       File "<string>", line 16, in <module>       File "c:\docume~1\yamamu~1\locals~1\temp\pip-build-YourName\ansible\ setup.py", line 17, in <module>         from ansible.constants import DEFAULT_MODULE_PATH       File "c:\docume~1\yamamu~1\locals~1\temp\pip-build-YourName\ansible\ lib\ansible\constants.py", line 19, in <module>         import pwd     ImportError: No module named pwd     Complete output from command python setup.py egg_info:     Traceback (most recent call last):   File "<string>", line 16, in <module>   File "c:\docume~1\yamamu~1\loca...

python import win32com.client -> EOFError in gencache.py

症状   import win32com.client   File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 11, in <module>     import gencache   File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 662, in <module>     __init__()   File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 56, in __init__     _LoadDicts()   File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 109, in _LoadDicts     version = p.load() EOFError   対処      move  C:\Python27\Lib\site-packages\win32com\gen_py\dicts.dat C:\Python27\Lib\site-packages\win32com\gen_py\dicts.dat.old  

Python スクリプトで出力している内容が Jenkins の Console にリアルタイムで出力されない。

症状 スクリプトをすべて完了しないと Python 内で行っている print の内容が、コンソールに出力されない。 対処 python の起動オプションに -u を追加する。

gvim を起動、あるいはコマンドを打とうとすると vp_pipe_open のエラーが起きる

対処 ちょっとちがうかも。 コマンドプロンプトより where gvim where vim を実行しパスが通っていたら、環境変数のPATHより取り除く。 ただし、システムパスになっている場合は、gvim.exe 、 vim.exe を適当な名前にリネーム         する。

rake redmine:plugins:migrate RAILS_ENV=production を行うと Duplicate Error Column Name などのエラーが起こる

症状        rake redmine:plugins:migrate RAILS_ENV=production       を実行すると、すでに存在するテーブル、あるいはすでに存在するカラムをaddしようとしてい       る旨のエラーがでる。 原因 DB移行作業時に'schema_migrations'の移行がされていなかったため、現行データベースの状況にあった適切なMigrationが実行できない。 対処 yaml_db のソースコードを修正する: vi ./.rvm/gems/ruby-1.9.3-p286/gems/yaml_db-0.2.3/lib/serialization_helper.rb 161行目ぐらいにある ActiveRecord::Base.connection.tables.reject { |table| ['schema_info', 'schema_migrations'].include?(table) } を ActiveRecord::Base.connection.tables.reject { |table| ['schema_info'].include?(table) }        とする。

rake db:migrate RAILS_ENV=production にて uninitialized constant Backlogs::IssueQueryPatch::RbRelease のエラーが出る

症状 rake db:migrate RAILS_ENV=production (in /home/redmine/redmine-2.3.1) rake aborted! uninitialized constant Backlogs::IssueQueryPatch::RbRelease /home/redmine/redmine-2.3.1/plugins/redmine_backlogs-1.0.5/lib/backlogs_issue_query_patch.rb:31:in `block in included' /home/redmine/redmine-2.3.1/plugins/redmine_backlogs-1.0.5/lib/backlogs_issue_query_patch.rb:25:in `class_eval' /home/redmine/redmine-2.3.1/plugins/redmine_backlogs-1.0.5/lib/backlogs_issue_query_patch.rb:25:in `included' /home/redmine/redmine-2.3.1/plugins/redmine_backlogs-1.0.5/lib/backlogs_issue_query_patch.rb:145:in `include' /home/redmine/redmine-2.3.1/plugins/redmine_backlogs-1.0.5/lib/backlogs_issue_query_patch.rb:145:in `<top (required)>' /home/redmine/redmine-2.3.1/plugins/redmine_backlogs-1.0.5/init.rb:27:in `block in <top (required)>' /home/redmine/.rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:440:in `_run__227089559__prepare__360480817...

rake db:dump で invalid byte sequence in UTF-8 エラーが出る

症状 rake db:dump RAILS_ENV=production --trace ** Invoke db:dump (first_time) ** Invoke db:schema:dump (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:schema:dump ** Invoke db:data:dump (first_time) ** Invoke environment ** Execute db:data:dump invalid byte sequence in UTF-8 /home/redmine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:225:in `count' /home/redmine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:225:in `binary?' /home/redmine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:234:in `visit_String' /home/redmine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:103:in `accept' /home/redmine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:313:in `block in visit_Array' /home/redmine/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych/visitors/yam...