Ruby 1.9.3 gem pg error in Ubuntu
Nov 21, 2014 0



rbenvを使ってRuby 1.9.3-p551
gem pg

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/vagrant/.rbenv/versions/1.9.3-p551/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
checking for libpq-fe.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
/home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:983:in `block in find_header'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:254:in `open'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:254:in `open'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
	from /home/vagrant/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:982:in `find_header'
	from extconf.rb:40:in `
' Gem files will remain installed in /var/www/html/hoge/vendor/bundle/ruby/1.9.1/gems/pg-0.13.2 for inspection. Results logged to /var/www/html/hoge/vendor/bundle/ruby/1.9.1/gems/pg-0.13.2/ext/gem_make.out An error occurred while installing pg (0.13.2), and Bundler cannot continue. Make sure that `gem install pg -v '0.13.2'` succeeds before bundling.



sudo apt-get install libpq-dev

Laravelのnginxの環境でassetsがNot found(404)
Nov 5, 2014 0


NginxでLaravelを使っているのですが、css、js、画像関係のassetがNot foundになったので、その際にnginxに設定方法下記のようにして対応しました。

  listen   80;
  server_name domain.com;
  access_log /var/log/nginx/domain.access.log;
  error_log /var/log/nginx/domain.error.log;
  set $root_path '/var/www/html/laravel/public';
  root  $root_path;
  index  index.php index.html;
  try_files $uri $uri/ @rewrite;
  location @rewrite {
    rewrite ^/(.*)$ /index.php?_url=/$1;

  location ~ \.php$ {
    root   /var/www/html/laravel/public;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;

  location ~ /\.ht {
    deny all;

  location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
    root   /var/www/html/laravel/public;
    expires max;
    add_header Cache-Control public;
    access_log off;

Laravelでbootstrap/autoload.php on line 17がでた
Nov 5, 2014 0




$ php artisan migrate --env=production
PHP Warning:  require(/var/www/html/laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/laravel/bootstrap/autoload.php on line 17


ローカルで、やる際は、Composerから入れるので、Composer installはあんまり叩かないので、地味に忘れていました。

$ composer install

Nov 2, 2014 0



$ composer create-project laravel/laravel project_name 4.1
$ cd project_name/
$ php artisan --version
Laravel Framework version 4.1.31


Oct 30, 2014 0





curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer global update
composer self-update
sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
source $HOME/.bashrc

Durpal 7はこんな感じで終了

composer global require drush/drush:dev-master



drush dl feeds
drush en feeds 



drush dl モジュール名 モジュールのダウンロード、関連のモジュールもダウンロード
drush en モジュール名 モジュールの有効化、関連のモジュールも有効化
drush dis モジュール名 モジュールの無効化
drush pm-list –type=Module –no-core –status=enabled 有効にしているモジュールの一覧

Core Drush commands: (core)

archive-dump (ard,archive-backup, arb) Backup your code, files, and database into a single file.
archive-restore(arr) Expand a site archive into a Drupal web site.
browse Display a link to a given path or open link in a browser.
core-cli (php) Open an interactive shell on a Drupal site.
core-config (conf,config) Edit drushrc, site alias, and Drupal settings.php files.
core-cron (cron) Run all cron hooks in all active modules for specified site.
core-execute (exec,execute) Execute a shell command. Usually used with a site alias.
core-quick-drupal(qd) Download, install, serve and login to Drupal with minimal configuration and dependencies.
core-requirements (status-report, rq) Provides information about things that may be wrong in your Drupal installation, if any.
core-rsync (rsync) Rsync the Drupal tree to/from another server using ssh.
core-status (status,st) Provides a birds-eye view of the current Drupal installation, if any.
core-topic (topic) Read detailed documentation on a given topic.
drupal-directory(dd) Return the filesystem path for modules/themes and other key folders.
help Print this help message. See `drush help help` for more options.
image-derive (id) Create an image derivative.
image-flush (if) Flush all derived images for a given style.
php-eval (eval, ev) Evaluate arbitrary php code after bootstrapping Drupal (if available).
php-script (scr) Run php script(s).
queue-list Returns a list of all defined queues
queue-run Run a specific queue by name
shell-alias (sha) Print all known shell alias records.
site-alias (sa) Print site alias records for all known site aliases and local sites.
site-install (si) Install Drupal along with modules/themes/configuration using the specified install profile.
site-set (use) Set a site alias to work on that will persist for the current session.
site-ssh (ssh) Connect to a Drupal site’s server via SSH for an interactive session or to run a shell command
test-clean Clean temporary tables and files.
test-run Run tests. Note that you must use the –uri option via the CLI or via a site alias.
updatedb (updb) Apply any database updates required (as with running update.php).
updatedb-status(updbst) List any pending database updates.
usage-send (usend) Send anonymous Drush usage information to statistics logging site. Usage statistics contain the Drush command name and the Drush option names, but no arguments or option values.
usage-show (ushow) Show Drush usage information that has been logged but not sent. Usage statistics contain the Drush command name and the Drush option names, but no arguments or option values.
variable-delete(vdel) Delete a variable.
variable-get (vget) Get a list of some or all site variables and values.
variable-set (vset) Set a variable.
version Show drush version.

Cache commands: (cache)

cache-clear(cc) Clear a specific cache, or all drupal caches.
cache-get(cg) Fetch a cached object and display it.
cache-rebuild(cr,rebuild) Rebuild a Drupal 8 site and clear all its caches.
cache-set(cs) Cache an object expressed in JSON or var_export() format.

Config commands: (config)

config-edit(cedit) Open a config file in a text editor. Edits are imported into active configration after closing editor.
config-export(cex) Export config from the active directory.
config-get(cget) Display a config value, or a whole configuration object.
config-import(cim) Import config from a config directory.
config-list (cli) List config names by prefix.
config-set(cset) Set config value directly in active configuration.

Field commands: (field)
field-clone Clone a field and all its instances.
field-create Create fields and instances. Returns urls for field editing.
field-delete Delete a field and its instances.
field-info View information about fields, field_types, and widgets.
field-update Return URL for field editing web page.

Project manager commands: (pm)
pm-disable (dis) Disable one or more extensions (modules or themes).
pm-download (dl) Download projects from drupal.org or other sources.
pm-enable (en) Enable one or more extensions (modules or themes).
pm-info (pmi) Show detailed info for one or more extensions (modules or themes).
pm-list (pml) Show a list of available extensions (modules and themes).
pm-refresh (rf) Refresh update status information.
pm-releasenotes(rln) Print release notes for given projects.
pm-releases (rl) Print release information for given projects.
pm-uninstall (pmu) Uninstall one or more modules.
pm-update (up) Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb).
pm-updatecode (upc) Update Drupal core and contrib projects to latest recommended releases.
pm-updatestatus(ups) Show a report of available minor updates to Drupal core and contrib projects.

Role commands: (role)
role-add-perm (rap) Grant specified permission(s) to a role.
role-create (rcrt) Create a new role.
role-delete (rdel) Delete a role.
role-list (rls) Display a list of all roles defined on the system. If a role name is provided as an argument, then all of the permissions of that role will be listed. If a permission name is provided as an option, then all of the roles that have been granted that permission will be listed.
role-remove-perm(rmp) Remove specified permission(s) from a role.

Runserver commands: (runserver)
runserver (rs) Runs PHP’s built-in http server for development.

SQL commands: (sql)
sql-cli (sqlc) Open a SQL command-line interface using Drupal’s credentials.
sql-connect A string for connecting to the DB.
sql-create Create a database.
sql-drop Drop all tables in a given database.
sql-dump Exports the Drupal DB as SQL using mysqldump or equivalent.
sql-query (sqlq) Execute a query against a database.
sql-sanitize(sqlsan) Run sanitization operations on the current database.
sql-sync Copies the database contents from a source site to a target site. Transfers the database dump via rsync.

Search commands: (search)
search-index Index the remaining search items without wiping the index.
search-reindex Force the search index to be rebuilt.
search-status Show how many items remain to be indexed out of the total.

State commands: (state)
state-delete (sdel) Delete a state value.
state-get (sget) Display a state value.
state-set (sset) Set a state value.

User commands: (user)
user-add-role (urol) Add a role to the specified user accounts.
user-block (ublk) Block the specified user(s).
user-cancel (ucan) Cancel a user account with the specified name.
user-create (ucrt) Create a user account with the specified name.
user-information(uinf) Print information about the specified user(s).
user-login (uli) Display a one time login link for the given user account (defaults to uid 1).
user-password (upwd) (Re)Set the password for the user account with the specified name.
user-remove-role(urrol) Remove a role from the specified user accounts.
user-unblock (uublk) Unblock the specified user(s).

Watchdog commands: (watchdog)
watchdog-delete Delete watchdog messages.
(wd-del, wd-delete)
watchdog-list(wd-list) Show available message types and severity levels. A prompt will ask for a choice to show watchdog messages.
watchdog-show(wd-show, ws) Show watchdog messages.

Other commands: (make)
make Turns a makefile into a working Drupal codebase.
make-generate(generate-makefile) Generate a makefile from the current Drupal site.

Sep 23, 2014 0



Administration menu

drush dl views ctools
drush en views views_ui ctools



iPhone 6 &Plus を過去の自分の持っていたAndroid Phone達と比較
Sep 10, 2014 0



Phone Memory CPU Strage OS
HTC Desire HD 768 MB 1 GHz Scorpion 8 GB Android 2.2
HTC One X 1 GB Quad-core 1.5 GHz 16 GB Android 4.0
Samsung Galaxy Note 2 2 GB Quad-core 1.6 GHz Cortex-A9 16 GB Android 4.1.1
Sony Xperia Z2 3 GB Quad-core 2.3 GHz Krait 400 16 GB Android 4.4.2
iPhone 5 1 GB Dual-core 1.3 GHz Swift 16 GB iOS 6
iPhone 5s 1 GB Dual-core 1.3 GHz Cyclone 16 GB iOS 7
iPhone 6 1 GB TBA(Apple A8) 16 GB iOS 8
iPhone 6 Plus 1 GB TBA(Apple A8) 16 GB iOS 8


Phone 購入日 価格
HTC Desire HD 2011/03/04 $540
HTC One X 2012/03/26 $550
Samsung Galaxy Note 2 2011/04/26 $650
Sony Xperia Z2 2014/05/20 $750
iPhone 5 2013/07/19 $726.36
iPhone 5s 2013/12/06 $869
iPhone 6 $869
iPhone 6 Plus $999


Phone 厚さ Inc 重さ
HTC Desire HD 123.00 68.0 11.8 4.3 inc 146 g
HTC One X 134.36 69.9 8.9 4.7 inc 130 g
Samsung Galaxy Note 2 151.1 80.5 9.4 5.5 inc 183 g
Sony Xperia Z2 146.8 73.3 8.2 5.4 inc 163 g
iPhone 6 138.1 67.0 6.9 4.7 inc 129 g
iPhone 6 Plus 158.1 77.8 7.1 5.5 inc 172 g

Aug 11, 2014 0




gem 'activeadmin', :git => 'git@github.com:gregbell/active_admin.git'


gem 'activeadmin', github: 'gregbell/active_admin'


Retrying git clone 'git://github.com/gregbell/active_admin.git' "/home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca" --bare --no-hardlinks --quiet due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git://github.com/gregbell/active_admin.git' "/home/vagrant/.rbenv/versions/2.0.0-p481/lib/ruby/gems/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca" --bare --no-hardlinks --quiet` in directory /vagrant/??? has failed.

地味に悩んだのですが、 git://をhttpsに変換するように、configに追加するようにして、herokuと同じ指定方法で動くようになりました。

git config --global url."https://".insteadOf git://

load-scripts.php のSyntax Errorで記事の編集画面JS関連が動かなくなる件
Jun 27, 2014 0


WordPressの本番環境の記事を編集する画面が、load-scripts.php のSyntax ErrorでVisual Editorなどが使えなくなりました。
Screen Shot 2014-06-27 at 10.25.31 pm




define( 'CONCATENATE_SCRIPTS', false );
define( 'COMPRESS_SCRIPTS', false );


git pushでDeployできるようするメモ
Jun 24, 2014 0





$ cd ~/
$ ssh-keygen -t rsa
$ tail ~/.ssh/id_rsa.pub 
ssh-rsa adadsa2!......nuias hoge@hoge.com


$ vi ~/.ssh/authorized_keys

これでssh username@serverhost.comなりで接続できるようになります。



$ mkdir -p ~/repo/hoge-blog.git
$ cd ~/repo/hoge-blog.git
$ git init --bare
$ cp hooks/post-update.sample hooks/post-update
$ vi hooks/post-update
echo "Pulling from git"
cd /var/www/hoge-blog; git --git-dir=.git pull
$ chmod +x ~/repo/hoge-blog.git/hooks/post-update

– post-updateの中に、exec git update-server-infoがあれば、その前に上記のCodeは追加してください。
– cd /var/www/hoge-blog; git –git-dir=.git pullの’/var/www/hoge-blog’はDeployのPathと合わせてください。



$ cd /var/www/
$ git clone  ~/repo/hoge-blog.git



$ cd ~/work/hoge-blog-local/
$ git remote add production username@serverhost.com:/home/usernmae/repo/hoge-blog



$ git push production master
remote: Pulling from git
remote: From /home/usernmae/repo/hoge-blog
remote:    as122..222de  master     -> origin/master
remote: Updating as122..222de

Search Keyword


face Ayumi Mizoshiri
WEB developer

Linkedin twitter Facebook mixi Last fm foursquare instagram