Ruby on Rails Tutorial 第2版 學習筆記

Ruby on Rails Tutorial 第2版html

在線閱讀:http://railstutorial-china.org/node

英文版:http://ruby.railstutorial.org/ruby-on-rails-tutorial-booklinux

本人環境:git

windows7下用VirtualBox裝的Ubuntu 13.04github

第一章 從零到部署web

安裝rvm,這樣就能自由的切換ruby版本shell

apt-get  install curl
#安裝rvm
curl -L https://get.rvm.io | bash
#啓動rvm
source /home/mafei/.rvm/scripts/rvm
Installing RVM to /home/mafei/.rvm/
Adding rvm PATH line to /home/mafei/.bashrc /home/mafei/.zshrc.
Adding rvm loading line to /home/mafei/.bash_profile /home/mafei/.zprofile.
Installation of RVM in /home/mafei/.rvm/ is almost complete:

* To start using RVM you need to run `source /home/mafei/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.

# mafei,
#
# 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

* WARNING: You have '~/.profile' file, you might want to load it,
to do that add the following line to '/home/mafei/.bash_profile':

source ~/.profile

執行到windows

gem install rails --version 4.0.0 --no-ri --no-rdoc

安裝rails報錯ruby

/home/mafei/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/atomic-1.1.14/lib/atomic/ruby.rb
Building native extensions.  This could take a while...
/home/mafei/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile
make
compiling atomic_reference.c
linking shared-object atomic_reference.so
make install
/usr/bin/install -c -m 0755 atomic_reference.so /home/mafei/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/atomic-1.1.14/lib/home/mafei/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/i686-linux
/usr/bin/install: 沒法建立普通文件"/home/mafei/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/atomic-1.1.14/lib/home/mafei/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/i686-linux": 沒有那個文件或目錄
make: *** [install-so] 錯誤 1
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.

Gem files will remain installed in /home/mafei/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/atomic-1.1.14 for inspection.
Results logged to /home/mafei/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/atomic-1.1.14/ext/gem_make.out

無奈,執行gem update --system ,將gem升級到最新bash

再次執行,安裝rails成功。

啓動rails server,提示

Could not find a Javascript runtime

安裝nodeJS

apt-get install nodejs
相關文章
相關標籤/搜索