rails控制台 [英] rails console on openshift
问题描述
我部署我的rails应用程序到openshift它的工作很好,但我不能在生产服务器上运行rails控制台。它给我这个错误。我如何解决这个问题?我试图更新rubygems,但它也给了权限被拒绝的错误,我也不能这样做。
rails c错误:
警告:你使用Rubygems 1.8.24和Spring。升级到至少Rubygems 2.1.0并运行`gem pristine --all`以获得更好的启动性能。
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in`require':无法加载这样的文件 - bundler / setup(LoadError)
从/ opt / rh / ruby193 / root / usr / share / rubygems / rubygems / custom_require.rb:36:在require中
从/ var / lib / openshift / 5429e72a500446dfee000197 / app-root / runtime / repo / bundle / ruby / 1.9.1 / gems / spring-1.1.3 / lib / spring / commands.rb:33:in`< module:Spring>'
从/ var / lib / openshift / 5429e72a500446dfee000197 / app -root / runtime / repo / vendor / bundle / ruby / 1.9.1 / gems / spring-1.1.3 / lib / spring / commands.rb:4:in`< top(必需)>'
从/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in`require'
从/ opt / rh / ruby193 / root / usr / share / rubygems / rubygems / custom_require.rb:36:在`require'
从/var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/ lib / spring / application.rb:77:在'preload'
从/var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring- 1.1.3 / lib / spring / application.rb:140:在`serve'
从/var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/ gem / spring-1.1.3 / lib / spring / application.rb:128:在`block in run'
从/ var / lib / openshift / 5429e72a500446dfee000197 / app-root / runtime / ruby / 1.9.1 / gems / spring-1.1.3 / lib / spring / application.rb:122:在`loop'
从/ var / lib / openshift / 5429e72a500446dfee000197 / app-root / runtime /
从/ var / lib / openshift / 5429e72a500446dfee000197 / app-root / dev / lib / spring / runtime / repo / vendor / bundle / ruby / 1.9.1 / gems / spring-1.1.3 / lib / spring / application / boot.rb:18:在`< top(必需)>'
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in`require'
从/ opt / rh / ruby193 / root / usr / share / rubygems / rubygems / custom_require .rb:36:in`require'
从-e:1:在`< main>'
rubygems更新错误:
[appname.rhcloud.com repo] \> update_rubygems
错误:执行gem ...(Errno :: EACCES)
权限被拒绝 - / opt / rh / ruby193 / root / usr / local / share / ruby
我无法获得任何 gem install
或 bundle exec
解决方案在OpenShift上运行4.1.4 Rails磁盘时工作。我的解决方案是在 app-root / repo
中运行 RAILS_ENV = production bin / rails c
$ b
I deployed my rails application to openshift it works well but I cannot run 'rails console' on production server. It gives me this error. How can I solve this? I tried to update rubygems but it also gives permission denied error and I couldn't make it too.
rails c error:
Warning: You're using Rubygems 1.8.24 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/commands.rb:33:in `<module:Spring>'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/commands.rb:4:in `<top (required)>'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:77:in `preload'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /var/lib/openshift/5429e72a500446dfee000197/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
from -e:1:in `<main>'
rubygems-update error:
[appname.rhcloud.com repo]\> update_rubygems
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /opt/rh/ruby193/root/usr/local/share/ruby
I couldn't get any of the gem install
or bundle exec
solutions to work while running the 4.1.4 Rails cartridge on OpenShift. My solution was running RAILS_ENV=production bin/rails c
in app-root/repo
.
这篇关于rails控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!