ubuntu 安装rails

Installing Ruby


sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# sudo apt-get install ruby

#sudo apt-get install ruby-dev

安装rubygems


如果ruby版本大于2.可以直接使用 :

sudo gem update --ststem

如果上面的不行:

https://rubygems.org/pages/download

这个是rubygems下载页面,可以在这个页面获取到最新rubygems的链接 

# wget https://rubygems.org/rubygems/rubygems-2.6.8.tgz 

tar -xzf rubygems-2.6.8.tgz 

cd rubygems-2.6.8

sudo ruby setup.rb


The last step is to install Bundler

gem install bundler
gem install rails
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
sudo apt-get install -y nodejs
And now for the moment of truth. Let's create your first Rails application:
#### If you want to use SQLite (not recommended)
rails new myapp

#### If you want to use MySQL
rails new myapp -d mysql

#### If you want to use Postgres
# Note that this will expect a postgres user with the same username
# as your app, you may need to edit config/database.yml to match the
# user you created earlier
rails new myapp -d postgresql

# Move into the application directory
cd myapp

# If you setup MySQL or Postgres with a username/password, modify the
# config/database.yml file to contain the username/password that you specified

# Create the database
rake db:create

rails server
You can now visit  http://localhost:3000  to view your new website!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值