rvmでRuby2.0をインストールしたついでにRails4.0を起動した


Ruby2.0を使ってみようとおもいました(☝ ՞ਊ ՞)

rvmでruby2.0をインストール

rvm use でruby2.0を使うとすると

rvm use 2.0
ruby-2.0.0-p195 is not installed.
To install do: ‘rvm install ruby-2.0.0-p195’

あれ?まだ入っていないみたいです(☝ ՞ਊ ՞)

installしろとあるのでrvm installをそのまま実行してみます。

rvm install ruby-2.0.0-p195
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-2.0.0-p195.
Continuing with compilation. Please read ‘rvm mount’ to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Updating certificates in ‘/usr/local/etc/openssl/cert.pem’.
Installing Ruby from source to: /Users/kawasakiosamu/.rvm/rubies/ruby-2.0.0-p195, this may take a while depending on your cpu(s)…
ruby-2.0.0-p195 – #downloading ruby-2.0.0-p195, this may take a while depending on your connection…
######################################################################## 100.0%
ruby-2.0.0-p195 – #extracting ruby-2.0.0-p195 to /Users/kawasakiosamu/.rvm/src/ruby-2.0.0-p195
ruby-2.0.0-p195 – #extracted to /Users/kawasakiosamu/.rvm/src/ruby-2.0.0-p195
ruby-2.0.0-p195 – #configuring
ruby-2.0.0-p195 – #compiling

Retrieving rubygems-2.0.10
There is no checksum for ‘http://production.cf.rubygems.org/rubygems/rubygems-2.0.10.tgz’ or ‘rubygems-2.0.10.tgz’, it’s not possible to validate it.
This could be because your RVM install’s list of versions is out of date. You may want to
update your list of rubies by running ‘rvm get stable’ and try again.
If that does not resolve the issue and you wish to continue with unverified download
add ‘–verify-downloads 1’ after the command.

There has been an error while trying to fetch rubygems.
Halting the installation.

たぶんインストールされたみたいです。しかしなんかエラーがでてますね(☝ ՞ਊ ՞)

rvm get stableを実行しろとありますので一応実行しておきます。

rvm get stable
######################################################################## 100.0%
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1082k 100 1082k 0 0 67909 0 0:00:16 0:00:16 –:–:– 140k

Upgrading the RVM installation in /Users/kawasakiosamu/.rvm/
RVM PATH line found in /Users/kawasakiosamu/.bashrc /Users/kawasakiosamu/.zshrc.
RVM sourcing line found in /Users/kawasakiosamu/.bash_profile /Users/kawasakiosamu/.zprofile.
Installing rvm gem in 1 gemsets ….
Upgrade of RVM in /Users/kawasakiosamu/.rvm/ is complete.

# Pugiemonn,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

# In case of problems:
# run and read: rvm notes
# read docs: http://rvm.io/
# talk to us: http://webchat.freenode.net/?channels=rvm (http://freenode.net/faq.shtml#plusr)
# read cheatsheet: http://cheat.errtheblog.com/s/rvm
# watch screencast: http://screencasts.org/episodes/how-to-use-rvm
# open a bug report: https://github.com/wayneeseguin/rvm/issues

Upgrade Notes:

* WARNING: You have ‘~/.profile’ file, you might want to load it,
to do that add the following line to ‘/Users/kawasakiosamu/.bash_profile’:

source ~/.profile

* Zsh 4.3.15 is buggy, be careful with it, it can break RVM, especially multiuser installations,
You should consider downgrading Zsh to 4.3.12 which has proven to work more reliable with RVM.
* RVM comes with a set of default gems including ‘bundler’, ‘rake’, ‘rubygems-bundler’ and ‘rvm’ gems;
if you do not wish to get these gems, install RVM with this flag: –without-gems=”rvm rubygems-bundler”
this option is remembered, it’s enough to use it once.

* RVM will try to automatically use available package manager, might require `sudo`,
read more about it in `rvm help autolibs`

* RVM 1.20.12 removes the automated –progress-bar from curl options,
if you liked this then you can restore this behavior with:

echo progress-bar >> ~/.curlrc

then run “rvm autolibs read-fail”, read more details: rvm help autolibs

RVM reloaded!

はい。これでOKみたいです。

よしもういっかいruby2.0を使ってみましょう

rvm use 2.0
ruby-2.0.0-p247 is not installed.
To install do: ‘rvm install ruby-2.0.0-p247’

え・・ruby-2.0.0-p247を入れろとかいわれました(;´༎ຶД༎ຶ`)

ではもう一回インストールします

rvm install ruby-2.0.0-p247
Searching for binary rubies, this might take some time.
Checking requirements for osx.
Certificates in ‘/usr/local/etc/openssl/cert.pem’ already are up to date.
Requirements installation successful.
ruby-2.0.0-p247 – #configure
ruby-2.0.0-p247 – #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5907k 100 5907k 0 0 428k 0 0:00:13 0:00:13 –:–:– 421k
ruby-2.0.0-p247 – #validate archive
ruby-2.0.0-p247 – #extract
ruby-2.0.0-p247 – #validate binary
ruby-2.0.0-p247 – #setup
Saving wrappers to ‘/Users/kawasakiosamu/.rvm/wrappers/ruby-2.0.0-p247’……..
ruby-2.0.0-p247 – #importing default gemsets, this may take time………………………….
Updating certificates in ‘/etc/openssl/cert.pem’. 略

こんどこそ

rvm use 2.0
Using /Users/kawasakiosamu/.rvm/gems/ruby-2.0.0-p247

成功したみたいです(☝ ՞ਊ ՞)☝

Railsを使ってみよう

rubyを変えたのでrailsを使ってみます。

rails –version
Rails is not currently installed on this system. To get the latest version, simply type:

$ sudo gem install rails

You can then rerun your “rails” command.

rubyを変えたのでrailsが入っていないそうですナンテコッタ

gem installをします。

sudo gem install rails

Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: multi_json-1.8.1.gem (100%)
Successfully installed multi_json-1.8.1
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.3 略

どうやらインストールが終わりました

railsのversionを確認します

rails –version
Rails is not currently installed on this system. To get the latest version, simply type:

$ sudo gem install rails

You can then rerun your “rails” command.

あれれ??おかしいです。インストールしたのに有効になりません。

rvmをreloadしてみようとりあえず

rvm reload
RVM reloaded!

もう一度railsのvesionを試すと

rails –version
Rails 4.0.0

おおーついにRails4になりました。やったね(☝ ՞ਊ ՞)

rubyを2にしましょう。

rvm use 2.0
Using /Users/kawasakiosamu/.rvm/gems/ruby-2.0.0-p247

新しいアプリケーションを作ります。

rails new mugenscore.com
create
create README.rdoc 以下略

ディレクトリを移動。

cd mugenscore.com

railsのserverを動かします。

rails s
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-10-05 21:59:20] INFO WEBrick 1.3.1
[2013-10-05 21:59:20] INFO ruby 2.0.0 (2013-06-27) [x86_64-darwin12.5.0]
[2013-10-05 21:59:20] INFO WEBrick::HTTPServer#start: pid=4744 port=3000

やった!!ついにruby2.0とrails4.0で起動しました(^o^)


“rvmでRuby2.0をインストールしたついでにRails4.0を起動した” への2件の返信

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です