我正在尝试按照 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/