【发布时间】:2015-01-03 04:00:26
【问题描述】:
我有一个数字海洋水滴,它可以在带有 Nginx 和 Unicorn 的 Ubuntu 14.04 上自动设置 Ruby on Rails。我正在尝试从 github (https://github.com/harrystech/prelaunchr) 运行 Ruby on Rails 应用程序,但只是复制文件似乎不起作用。我不是 Rails 专家,所以你能提供的任何帮助都会很棒。看起来 github 项目是一个完整的工作应用程序,我只需要弄清楚如何让它在我的数字海洋水滴上工作。我也找不到这方面的任何指南!
编辑:我在数字海洋的帮助下解决了这个问题!在 rails droplet 上安装 ruby,然后 ssh 进入 droplet 并执行以下操作:
rm -rf /home/rails/*
cd /home/rails/
git clone https://github.com/harrystech/prelaunchr.git .
nano Gemfile # Add "gem 'mysql2'"
nano config/database.yml # Change 'postgres' to 'mysql2' and add user/pass for the database
gem list | cut -d" " -f1 | xargs gem uninstall -aIx # Uninstall gems that might conflict
bundle install
bundle exec rake db:create db:schema:load db:seed
nano config/environments/production.rb # Set `config.assets.compile = true`
chown -R rails:www-data *
service unicorn restart
exec bundle rails s -d
您的应用现在应该在 yourip:3000 woo hoo 启动并运行!
【问题讨论】:
-
他们都没有真正了解如何从 github 安装...
-
啊,现在我明白了你的问题,你需要从那个教程中改变一件大事,当他们说,
rails new testapp --skip-bundle你需要将文件从本地仓库复制到一个文件夹在数字海洋中,您可以通过 git 或 ssh 做到这一点。有很多方法可以做到这一点,重要的是你复制文件夹。 -
我在数字海洋的帮助下想通了!
标签: ruby-on-rails github digital-ocean