Category - Mac OSX

Mac rbenv

# git clone https://github.com/rbenv/rbenv.git ~/.rbenv
# cd ~/.rbenv && src/configure && make -C src

# vi .bash_profile

----------------------------
# rbenv
export RBENV_ROOT="$HOME/.rbenv"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
----------------------------

# source ~/.bash_profile

# mkdir -p "$(rbenv root)"/plugins
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# rbenv install 2.7.0
# rbenv global 2.7.0
# gem install railties && rbenv rehash
# gem install sqlite3 puma sass-rails uglifier coffee-rails jquery-rails turbolinks jbuilder byebug web-console listen spring spring-watcher-listen
# gem update --system
# gem update

read more

You don't have write permissions for the /usr/bin directory.

% sudo gem install rails
Fetching zeitwerk-2.3.0.gem
Fetching activesupport-6.0.2.1.gem
Fetching rack-2.2.2.gem
Fetching rack-test-1.1.0.gem
Fetching crass-1.0.6.gem
Fetching loofah-2.4.0.gem
Fetching rails-html-sanitizer-1.3.0.gem
Fetching rails-dom-testing-2.0.3.gem
Fetching builder-3.2.4.gem
Fetching erubi-1.9.0.gem
Fetching actionview-6.0.2.1.gem
Fetching actionpack-6.0.2.1.gem
Fetching activemodel-6.0.2.1.gem
Fetching activerecord-6.0.2.1.gem
Fetching globalid-0.4.2.gem
Fetching activejob-6.0.2.1.gem
Fetching websocket-extensions-0.1.4.gem
Fetching mini_mime-1.0.2.gem
Fetching mail-2.7.1.gem
Fetching actionmailer-6.0.2.1.gem
Fetching nio4r-2.5.2.gem
Fetching actioncable-6.0.2.1.gem
Fetching mimemagic-0.3.4.gem
Fetching websocket-driver-0.7.1.gem
Fetching marcel-0.3.3.gem
Fetching activestorage-6.0.2.1.gem
Fetching actionmailbox-6.0.2.1.gem
Fetching actiontext-6.0.2.1.gem
Fetching thor-1.0.1.gem
Fetching method_source-0.9.2.gem
Fetching railties-6.0.2.1.gem
Fetching sprockets-4.0.0.gem
Fetching sprockets-rails-3.2.1.gem
Fetching rails-6.0.2.1.gem
Successfully installed zeitwerk-2.3.0
Successfully installed activesupport-6.0.2.1
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.


インストールする場所をオプションで指定する

% sudo gem install rails -n /usr/local/bin
Successfully installed rack-2.2.2
Successfully installed rack-test-1.1.0
Successfully installed crass-1.0.6
Successfully installed loofah-2.4.0
Successfully installed rails-html-sanitizer-1.3.0
Successfully installed rails-dom-testing-2.0.3
Successfully installed builder-3.2.4
Successfully installed erubi-1.9.0
Successfully installed actionview-6.0.2.1
Successfully installed actionpack-6.0.2.1
Successfully installed activemodel-6.0.2.1
Successfully installed activerecord-6.0.2.1
Successfully installed globalid-0.4.2
Successfully installed activejob-6.0.2.1
Successfully installed mini_mime-1.0.2
Successfully installed mail-2.7.1
Successfully installed actionmailer-6.0.2.1
Building native extensions. This could take a while...
Successfully installed nio4r-2.5.2
Successfully installed websocket-extensions-0.1.4
Building native extensions. This could take a while...
Successfully installed websocket-driver-0.7.1
Successfully installed actioncable-6.0.2.1
Successfully installed mimemagic-0.3.4
Successfully installed marcel-0.3.3
Successfully installed activestorage-6.0.2.1
Successfully installed actionmailbox-6.0.2.1
Successfully installed actiontext-6.0.2.1
Successfully installed thor-1.0.1
Successfully installed method_source-0.9.2
Successfully installed railties-6.0.2.1
Successfully installed sprockets-4.0.0
Successfully installed sprockets-rails-3.2.1
Successfully installed rails-6.0.2.1
Parsing documentation for rack-2.2.2
Installing ri documentation for rack-2.2.2
Parsing documentation for rack-test-1.1.0
Installing ri documentation for rack-test-1.1.0
Parsing documentation for crass-1.0.6
Installing ri documentation for crass-1.0.6
Parsing documentation for loofah-2.4.0
Installing ri documentation for loofah-2.4.0
Parsing documentation for rails-html-sanitizer-1.3.0
Installing ri documentation for rails-html-sanitizer-1.3.0
Parsing documentation for rails-dom-testing-2.0.3
Installing ri documentation for rails-dom-testing-2.0.3
Parsing documentation for builder-3.2.4
Installing ri documentation for builder-3.2.4
Parsing documentation for erubi-1.9.0
Installing ri documentation for erubi-1.9.0
Parsing documentation for actionview-6.0.2.1
Installing ri documentation for actionview-6.0.2.1
Parsing documentation for actionpack-6.0.2.1
Installing ri documentation for actionpack-6.0.2.1
Parsing documentation for activemodel-6.0.2.1
Installing ri documentation for activemodel-6.0.2.1
Parsing documentation for activerecord-6.0.2.1
Installing ri documentation for activerecord-6.0.2.1
Parsing documentation for globalid-0.4.2
Installing ri documentation for globalid-0.4.2
Parsing documentation for activejob-6.0.2.1
Installing ri documentation for activejob-6.0.2.1
Parsing documentation for mini_mime-1.0.2
Installing ri documentation for mini_mime-1.0.2
Parsing documentation for mail-2.7.1
Installing ri documentation for mail-2.7.1
Parsing documentation for actionmailer-6.0.2.1
Installing ri documentation for actionmailer-6.0.2.1
Parsing documentation for nio4r-2.5.2
Installing ri documentation for nio4r-2.5.2
Parsing documentation for websocket-extensions-0.1.4
Installing ri documentation for websocket-extensions-0.1.4
Parsing documentation for websocket-driver-0.7.1
Installing ri documentation for websocket-driver-0.7.1
Parsing documentation for actioncable-6.0.2.1
Installing ri documentation for actioncable-6.0.2.1
Parsing documentation for mimemagic-0.3.4
Installing ri documentation for mimemagic-0.3.4
Parsing documentation for marcel-0.3.3
Installing ri documentation for marcel-0.3.3
Parsing documentation for activestorage-6.0.2.1
Installing ri documentation for activestorage-6.0.2.1
Parsing documentation for actionmailbox-6.0.2.1
Installing ri documentation for actionmailbox-6.0.2.1
Parsing documentation for actiontext-6.0.2.1
Installing ri documentation for actiontext-6.0.2.1
Parsing documentation for thor-1.0.1
Installing ri documentation for thor-1.0.1
Parsing documentation for method_source-0.9.2
Installing ri documentation for method_source-0.9.2
Parsing documentation for railties-6.0.2.1
Installing ri documentation for railties-6.0.2.1
Parsing documentation for sprockets-4.0.0
Installing ri documentation for sprockets-4.0.0
Parsing documentation for sprockets-rails-3.2.1
Installing ri documentation for sprockets-rails-3.2.1
Parsing documentation for rails-6.0.2.1
Installing ri documentation for rails-6.0.2.1
Done installing documentation for rack, rack-test, crass, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubi, actionview, actionpack, activemodel, activerecord, globalid, activejob, mini_mime, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, mimemagic, marcel, activestorage, actionmailbox, actiontext, thor, method_source, railties, sprockets, sprockets-rails, rails after 37 seconds
32 gems installed


% rails -v
Rails 6.0.2.1

read more

rbenv update

rbenvを個別にインストールしている場合

% cd ~/.rbenv/plugins/ruby-build
% git pull
% rbenv install --list

read more

Mac OSX でのCPAN

Testing handle creation speed...
9523 NullP sth/s perl 5.008006 darwin-thread-multi-2level (gcc 3.3 -Os) 0.000105s

test.pl done
/usr/bin/make test -- OK
Running make install
Manifying blib/man1/dbiproxy.1
Warning: You do not have permissions to install into /usr/local/man/man1 at /System/Library/Perl/5.8.6/ExtUtils/Install.pm line 114.
mkdir /usr/local/man/man3: Permission denied at /System/Library/Perl/5.8.6/ExtUtils/Install.pm line 112
make: *** [pure_site_install] Error 255
/usr/bin/make install -- NOT OK

一般のユーザーでインストールするとこんな風になるようです。

sudo cpan で行うとうまくいきます。

All tests successful, 1 test skipped.
Files=4, Tests=567, 23 wallclock secs ( 5.62 cusr + 12.00 csys = 17.62 CPU)
/usr/bin/make test -- OK
Running make install
Installing /System/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DB_File/DB_File.bundle
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /System/Library/Perl/5.8.6/darwin-thread-multi-2level/DB_File.pm
Installing /System/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DB_File/autosplit.ix
Installing /usr/share/man/man3/DB_File.3pm
Writing //System/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DB_File/.packlist
Appending installation info to //System/Library/Perl/5.8.6/darwin-thread-multi-2level/perllocal.pod
/usr/bin/make install -- OK

read more

Mac OSX Perl 5.8.8 インストール

ftp://ftp.cpan.org/pub/CPAN/src/

ここからperl-5.8.8.tar.gzをダウンロードします

tar xvzf perl-5.8.8.tar.gz
sudo chown -R $User:wheel perl-5.8.8
cd perl-5.8.8
./configure
make
sudo make install

/usr/local/bin/perlにインストールされるので現在のperlと置き換えます
/usr/bin/perl -v
/usr/local/bin/perl -v
mv /usr/bin/perl /usr/bin/perl_org
sudo mv /usr/bin/perl /usr/bin/perl_org
sudo ln -snf /usr/local/bin/perl /usr/bin/perl

perl -v
This is perl, v5.8.8 built for darwin-2level

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

read more

Mac OSX でのPHP設定

OSXにはApacheとPHPはデフォでインストールされているそうです

コマンドパス:/usr/sbin/apachectl
設定ファイル:/ete/httpd/httpd.conf

LoadModule php4_module
AddModule mod_php4.c
この行のコメントをはずして有効にする

sudo /usr/sbin/apachectl start

Configure Command
'/SourceCache/apache_mod_php/apache_mod_php-17/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc'

コンパイルオプションが渋いですね~

read more

Recent entry

Search

Tag Cloud

Page Top