ruby - Discourse 安装 - 安装必要的 gems 会报错

标签 ruby ubuntu discourse

我正在尝试按照 installation instructions 安装 Discourse ,但指令

# Install necessary gems
bundle install --deployment --without test

给出这个错误
discourse@ubuntu:/var/www/discourse$ bundle install --deployment --without test
Gemfile syntax error:
/var/www/discourse/Gemfile:45: syntax error, unexpected
':', expecting $end
gem 'seed-fu-discourse', require: 'seed-fu'
                                 ^

我怎样才能解决这个问题?



编辑

看来我使用的 ruby​​ 少于 1.9。但我对此感到困惑。根据我输入的安装说明
# Build and install ruby
rvm install 2.0.0

但后来我检查了版本
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

我尝试(根据评论之一)
$ rvm use 1.9.3
RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

我去访问referenced site但我无法更改 gnome 终端设置,因为我正在使用没有 GUI 的 ubuntu 服务器。我一直在尝试从命令行通过 .bashrc但到目前为止我做不到。我对此有疑问here .

最佳答案

rvm use 2.0.0所以你会真正使用它。考虑添加名为 .ruby-version 的文件使用此类内容到您的应用程序的根目录:

2.0.0

所以从那时起 rvm 应该在进入项目目录时自动更改 ruby​​ 版本。

关于 RVM 不是函数...这里对其进行了描述和回答:rvm installation not working: "RVM is not a function"

关于ruby - Discourse 安装 - 安装必要的 gems 会报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20871891/

相关文章:

ruby-on-rails - 如何在 Ruby on Rails 网站上禁用显式堆栈跟踪

ruby - 如何根据编码字符串 Ruby 返回解码后的字符串

ruby-on-rails - 在 2 个 Rails 应用程序之间共享测试数据

bash - 为什么我的 "ll"命令不在一个帐户中运行,而是在另一个帐户中运行?

docker - 在Openshift Online上安装Discourse(Docker镜像)

javascript - Ember 模板约定

jquery - 如何在 Rails find_by_sql 和 group_by 中传递变量

linux - 编写一个 shell 脚本来搜索文件中的复杂字符串以及它的出现次数

linux - 有没有办法从 linux 的系统日志中检索消息的严重级别?

apache - 在一台服务器上讨论 Docker 和 Apache