简体   繁体   English

红宝石在Ubuntu的轨道上

[英]ruby on rails on ubuntu

I just got ubuntu installed recently and I'm trying to get ruby on rails up and running. 我刚安装了ubuntu,现在正在尝试使ruby正常运行。 I'm working through this tutorial - http://ruby.railstutorial.org/ruby-o...c-introduction 我正在阅读本教程-http: //ruby.railstutorial.org/ruby-o...c-introduction

When I run $ rails -v or $ rails new first_app I get the following error... 当我运行$ rails -v或$ rails new first_app时,出现以下错误...

The program 'rails' can be found in the following packages: *rails *ruby-railties-3.2 Try: sudo apt-get install 程序“ rails”可以在以下软件包中找到:* rails * ruby​​-railties-3.2试试:sudo apt-get install

Being new to both ubuntu and rails, I'm not sure what to do here. 对于ubuntu和Rails都是新手,我不确定该怎么做。 Any suggestions? 有什么建议么? Thanks. 谢谢。

Best way to install ruby, rails etc is through RVM. 安装红宝石的最佳方式,轨道等是通过RVM。 Follow the following links. 请点击以下链接。 They'll guide you through. 他们会引导您完成。

http://www.unfoldingcode.com/2011/05/using-rvm-to-install-rails-31-on-ubuntu.html http://siliconchaos.com/2011/07/installing-rails-with-rvm/ http://www.unfoldingcode.com/2011/05/using-rvm-to-install-rails-31-on-ubuntu.html http://siliconchaos.com/2011/07/installing-rails-with-rvm /

Following are the steps to setup Ruby on rails on Ubuntu: 以下是在Ubuntu Ruby on rails上设置Ruby on rails的步骤:

  1. you need to import the RVM GPG Key: 您需要导入RVM GPG密钥:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

  1. Then install RVM 然后安装RVM

curl -sSL https://get.rvm.io | bash -s stable

  1. load the RVM script 加载RVM脚本

source ~/.rvm/scripts/rvm

Following are the steps to create new rails app: 以下是创建新的Rails应用程序的步骤:

1. rails new demo 
2. cd demo
3. rake db:create
4. rails server

Try this link. 试试这个链接。 Explained all three ways to install Ruby ( RVM, rbenv and through source) and to setup rails for latest versions of ubuntu separately including DB setup ( MySQL and Postgres). 解释了安装Ruby的所有三种方式(RVM,rbenv和通过源代码)以及分别为最新版本的ubuntu(包括DB设置)(MySQL和Postgres)设置导轨的方法。

https://gorails.com/setup/ubuntu/17.04 https://gorails.com/setup/ubuntu/17.04

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM