• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

RubyonRailsTutorial第2版学习笔记

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

Ruby on Rails Tutorial 第2版

在线阅读:http://railstutorial-china.org/

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

本人环境:

windows7下用VirtualBox装的Ubuntu 13.04

第一章 从零到部署

安装rvm,这样就能自由的切换ruby版本

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

执行到

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

安装rails报错

/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升级到最新

再次执行,安装rails成功。

启动rails server,提示

Could not find a Javascript runtime

安装nodeJS

apt-get install nodejs

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Laravel 5.2 INSTALL- node's npm and ruby's bundler.发布时间:2022-07-14
下一篇:
InstallingRuby2.2onCentos7发布时间:2022-07-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap