简体   繁体   English

在Linux Mint 17上安装Ruby on Rails

[英]Install Ruby on Rails on Linux Mint 17

I have been struggling this task. 我一直在努力完成这项任务。 I have been developing in php but want to switch to ruby. 我一直在开发php但想切换到ruby。 My question is how do I install ruby on rails on Linux Mint 17. 我的问题是如何在Linux Mint 17上的rails上安装ruby。

After installing rvm, just type gem install rails and you are ready with rails. 安装rvm后,只需键入gem install rails即可使用rails。

For an IDE I think a popular choice is RubyMine and if you are into text editors you can try using Vim or another popular choice Sublime text editor . 对于IDE,我认为流行的选择是RubyMine ,如果你是文本编辑器,你可以尝试使用Vim或其他流行的选择Sublime文本编辑器

I would recommend using editor in the beginning, just to get used to the terminal and all the ruby tools out there like rails , rake , rspec etc. 我建议在开始时使用编辑器,只是为了习惯终端和所有ruby工具,如railsrakerspec等。

I just installed ruby2.2 & rail4.2 on mint mate 17 via rvm & gem . 我刚刚通过rvmgem在薄荷伴侣17上安装了ruby2.2rail4.2

Steps: 脚步:

  • [install rvm] [安装rvm]
  • open vim 打开vim
  • \\curl -sSL https://get.rvm.io | \\ curl -sSL https://get.rvm.io | bash -s stable bash -s稳定
  • reopen a vim 重新打开一个vim
  • rvm -v rvm -v
  • [install ruby] [安装红宝石]
  • sudo apt-get purge ruby (this will remove old ruby that is not installed by rvm) sudo apt-get purge ruby (这将删除rvm未安装的旧ruby)
  • rvm list known (this will show available ruby versions) 已知rvm列表(这将显示可用的ruby版本)
  • rvm install 2.2.0 (it's quite smart, will do a lot check, might take a while) rvm install 2.2.0 (很聪明,会做很多检查,可能需要一段时间)
  • setup GEM_HOME, and choose ruby version via rvm use ruby-2.2.0 (I didn't use this way, for some reason) 设置GEM_HOME,并通过rvm use ruby-2.2.0选择ruby版本rvm use ruby-2.2.0 (由于某种原因,我没有使用这种方式)
  • or, put ~/.rvm/rubies/ruby-2.2.0/bin to your PATH, by hand, (I use this way, because I have a common config file for such things) 或者, ~/.rvm/rubies/ruby-2.2.0/bin~/.rvm/rubies/ruby-2.2.0/bin放到PATH中(我用这种方式,因为我有一个共同的配置文件用于此类事情)
  • reboot or re-login or source some_file , (depends on your configuration) 重新启动或重新登录或source some_file(取决于您的配置)
  • ruby -v 红宝石-v
  • [install rails] [安装导轨]
  • gem install rails (install to "current_ruby/bin/" inside rvm folder,) gem install rails (安装到rvm文件夹里面的“current_ruby / bin /”)
  • rails -v rails -v
  • done DONE

Issues 问题

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

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