部署Rails站点的问题

时间:2014-04-16 17:37:20

标签: ruby-on-rails ruby-on-rails-4

我正在尝试在商业托管服务上部署网站。 (JustHost.com) 我在运行bundle

时遇到以下问题
# bundle
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Gem::Exception: Cannot load gem at [/usr/lib64/ruby/gems/1.9.3/cache/rake-10.3.0.gem] in /home5/<username>/<sitename>
An error occurred while installing rake (10.3.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.3.0'` succeeds before bundling.

我能够成功运行gem install命令:

# gem install rake -v '10.3.0'
Successfully installed rake-10.3.0
1 gem installed
Installing ri documentation for rake-10.3.0...
Installing RDoc documentation for rake-10.3.0...

但是我得到了重新运行bundle的错误。此外,我不认为我实际上能够安装rake - 我的位置不可写,版本没有变化:

# which rake
/usr/bin/rake

# rake --version
rake, version 0.9.2.2

我也尝试更新我的Gemfile以使用rake 0.9.2.2。但遇到了同样的问题:

# bundle
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Gem::Exception: Cannot load gem at [/usr/lib64/ruby/gems/1.9.3/cache/rake-0.9.2.2.gem] in /home5/<username>/<sitename>
An error occurred while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.

任何帮助表示赞赏!

1 个答案:

答案 0 :(得分:0)

我做的是根据说明here更新.bashrc文件。我还必须设置一个javascript运行时,所以我使用了gems ruby​​racer和execjs。