热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

升级TurnkeyRails虚拟机到最新Rails版本

具体步骤如下:1.选择用root来安装2.安装curl#Installcurl.Itsneededtoinstallrvmtheeasyway.Ignoretheerroraboutthejava.so:apt-getinstallcurl3.安装rvm#Installrvm:(这里bash后面是一个空格,然后,再一个空格)bash(curl

具体步骤如下:

1.选择用root来安装

2.安装curl

# Install curl. It's needed to install rvm the easy way. Ignore the error about the java .so:
  apt-get install curl
3. 安装rvm

# Install rvm:(这里bash后面是一个空格,然后<,再一个空格)
  bash <<(curl -s https://rvm.beginrescueend.com/install/rvm)


4. 安装在RVM下Ruby1.9.2

# Install 1.9.2 under rvm:
  rvm install ruby-1.9.2

5. 指定使用1.9.2
# Make it the default:
  rvm use ruby-1.9.2 --default
# Change to it (although the --default line probably does this):
  rvm use ruby-1.9.2-p(patchlevel)

6. 创建gemset
# Gemset for Rails 3:
  rvm gemset create rails3
# Use that gemset:
  rvm gemset use rails3
# (Re-) Install Rails:
  gem install rails
(具体安装版本3.1.0, 会看到一些unable to covert和file 'lib'  not found, 可以忽略)

  rails -v 可以看到安装的rails版本

7. 安装Passenger(RoR的部署技术)

# (Re-) Install Passenger:
  gem install passenger
# Install the necessary prerequisite library:
  apt-get install libcurl4-openssl-dev
 
Compile and install the Passenger module. First you have to find the version of Passenger that you just installed (which is in a different place from the one preinstalled in the appliance):
  find /usr/local/rvm -name passenger-install-apache2-module
 
Two paths will appear, one of them in bin and the other one in gems. Take the shorter one and copy it. For my system, the two paths were:
  /usr/local/rvm/gems/ruby-1.9.2-p290@rails3/bin/passenger-install-apache2-module
  and
  /usr/local/rvm/gems/ruby-1.9.2-p290@rails3/gems/passenger-3.0.8/bin/passenger-install-apache2-module
 
Run that script:
/usr/local/rvm/gems/ruby-1.9.2-p290@rails3/bin/passenger-install-apache2-module
 
IMPORTANT: Grab the configuration lines at the end of the passenger install process! If you just use the default Passenger LoadModule, PassengerRoot, and PassengerRuby lines the GEM_HOME and paths won't be set up correctly, and you'll run into issues like "bundler: cannot load file". For my system, those lines were:
  LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.2-p290@rails3/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
  PassengerRoot /usr/local/rvm/gems/ruby-1.9.2-p290@rails3/gems/passenger-3.0.9
  PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.2-p290@rails3/ruby
 
In /etc/apache2/conf.d/passenger, replace the three corresponding lines with the new stuff you copied.
 
8. 安装Node.js (不安装Rails 3.1会报这个错误 Could not find a Javascript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable))

apt-get install python-software-properties
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs

Set up your Rails application in /var/www/railsapp, do a bundle install, restart Apache (/etc/init.d/apache2 restart), and you're golden!


推荐阅读
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 闭包一直是Java社区中争论不断的话题,很多语言都支持闭包这个语言特性,闭包定义了一个依赖于外部环境的自由变量的函数,这个函数能够访问外部环境的变量。本文以JavaScript的一个闭包为例,介绍了闭包的定义和特性。 ... [详细]
  • 树莓派语音控制的配置方法和步骤
    本文介绍了在树莓派上实现语音控制的配置方法和步骤。首先感谢博主Eoman的帮助,文章参考了他的内容。树莓派的配置需要通过sudo raspi-config进行,然后使用Eoman的控制方法,即安装wiringPi库并编写控制引脚的脚本。具体的安装步骤和脚本编写方法在文章中详细介绍。 ... [详细]
  • 本文介绍了Composer依赖管理的重要性及使用方法。对于现代语言而言,包管理器是标配,而Composer作为PHP的包管理器,解决了PEAR的问题,并且使用简单,方便提交自己的包。文章还提到了使用Composer能够避免各种include的问题,避免命名空间冲突,并且能够方便地安装升级扩展包。 ... [详细]
  • Android日历提醒软件开源项目分享及使用教程
    本文介绍了一款名为Android日历提醒软件的开源项目,作者分享了该项目的代码和使用教程,并提供了GitHub项目地址。文章详细介绍了该软件的主界面风格、日程信息的分类查看功能,以及添加日程提醒和查看详情的界面。同时,作者还提醒了读者在使用过程中可能遇到的Android6.0权限问题,并提供了解决方法。 ... [详细]
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 本文介绍了在Win10上安装WinPythonHadoop的详细步骤,包括安装Python环境、安装JDK8、安装pyspark、安装Hadoop和Spark、设置环境变量、下载winutils.exe等。同时提醒注意Hadoop版本与pyspark版本的一致性,并建议重启电脑以确保安装成功。 ... [详细]
  • Google Play推出全新的应用内评价API,帮助开发者获取更多优质用户反馈。用户每天在Google Play上发表数百万条评论,这有助于开发者了解用户喜好和改进需求。开发者可以选择在适当的时间请求用户撰写评论,以获得全面而有用的反馈。全新应用内评价功能让用户无需返回应用详情页面即可发表评论,提升用户体验。 ... [详细]
  • 【MicroServices】【Arduino】装修甲醛检测,ArduinoDart甲醛、PM2.5、温湿度、光照传感器等,数据记录于SD卡,Python数据显示,UI5前台,微服务后台……
    这篇文章介绍了一个基于Arduino的装修甲醛检测项目,使用了ArduinoDart甲醛、PM2.5、温湿度、光照传感器等硬件,并将数据记录于SD卡,使用Python进行数据显示,使用UI5进行前台设计,使用微服务进行后台开发。该项目还在不断更新中,有兴趣的可以关注作者的博客和GitHub。 ... [详细]
  • 本文介绍了Linux Shell中括号和整数扩展的使用方法,包括命令组、命令替换、初始化数组以及算术表达式和逻辑判断的相关内容。括号中的命令将会在新开的子shell中顺序执行,括号中的变量不能被脚本余下的部分使用。命令替换可以用于将命令的标准输出作为另一个命令的输入。括号中的运算符和表达式符合C语言运算规则,可以用在整数扩展中进行算术计算和逻辑判断。 ... [详细]
  • 一句话解决高并发的核心原则
    本文介绍了解决高并发的核心原则,即将用户访问请求尽量往前推,避免访问CDN、静态服务器、动态服务器、数据库和存储,从而实现高性能、高并发、高可扩展的网站架构。同时提到了Google的成功案例,以及适用于千万级别PV站和亿级PV网站的架构层次。 ... [详细]
  • Java如何导入和导出Excel文件的方法和步骤详解
    本文详细介绍了在SpringBoot中使用Java导入和导出Excel文件的方法和步骤,包括添加操作Excel的依赖、自定义注解等。文章还提供了示例代码,并将代码上传至GitHub供访问。 ... [详细]
  • node.jsurlsearchparamsAPI哎哎哎 ... [详细]
author-avatar
mobiledu2502895753
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有