Skip to content

Instantly share code, notes, and snippets.

@yuyalush
Last active August 29, 2015 14:00
Show Gist options
  • Save yuyalush/03d4c12065ad078eb31e to your computer and use it in GitHub Desktop.
Save yuyalush/03d4c12065ad078eb31e to your computer and use it in GitHub Desktop.
Setup Ruby2.1.1 and Rails on Ubuntu14.04
sudo apt-get -y install git libssl-dev build-essential
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
source .profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'install: --no-ri --no-rdoc' >> ~/.gemrc
echo 'update: --no-ri --no-rdoc' >> ~/.gemrc
rbenv install 2.1.1
rbenv global 2.1.1
sudo gem install bundler
rbenv rehash
sudo apt-get -y install sqlite3 libsqlite3-dev
mkdir devrails
cd devrails
bundle init
sed -i -e "4 s/# //" Gemfile
bundle install --path vendor/bundle
bundle exec rails new example --skip-bundle
cd example
sed -i -e "15 s/# //" Gemfile
bundle install --path vendor/bundle
bundle exec rails g scaffold book title:string price:integer
bundle exec rake db:migrate
bundle exec rails s
@steven37788
Copy link

could you tell me how to fix the problem, bundle is not found.

解压缩后会消耗掉 1,656 kB 的额外空间。
获取:1 http://mirrors.163.com/ubuntu/ trusty/main libsqlite3-dev amd64 3.8.2-1ubuntu2 [439 kB]
获取:2 http://mirrors.163.com/ubuntu/ trusty/main sqlite3 amd64 3.8.2-1ubuntu2 [28.9 kB]
下载 467 kB,耗时 1秒 (347 kB/s)
Selecting previously unselected package libsqlite3-dev:amd64.
(正在读取数据库 ... 系统当前共安装有 180438 个文件和目录。)
Preparing to unpack .../libsqlite3-dev_3.8.2-1ubuntu2_amd64.deb ...
Unpacking libsqlite3-dev:amd64 (3.8.2-1ubuntu2) ...
Selecting previously unselected package sqlite3.
Preparing to unpack .../sqlite3_3.8.2-1ubuntu2_amd64.deb ...
Unpacking sqlite3 (3.8.2-1ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1) ...
正在设置 libsqlite3-dev:amd64 (3.8.2-1ubuntu2) ...
正在设置 sqlite3 (3.8.2-1ubuntu2) ...
./setup.sh: 行 16: bundle: 未找到命令
sed: 无法读取 Gemfile: 没有那个文件或目录
./setup.sh: 行 18: bundle: 未找到命令
./setup.sh: 行 19: bundle: 未找到命令
./setup.sh: 第 20 行: cd: example: 没有那个文件或目录
sed: 无法读取 Gemfile: 没有那个文件或目录
./setup.sh: 行 22: bundle: 未找到命令
./setup.sh: 行 23: bundle: 未找到命令
./setup.sh: 行 24: bundle: 未找到命令
./setup.sh: 行 25: bundle: 未找到命令

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment