在 Ubuntu Lucid Lynx 上安装 Heroku 已损坏
我正在尝试在某个地方免费托管一个 Ruby on Rails 应用程序,而 Heroku 看起来像是我最后的资源。它应该在 Linux 上工作,并且 gem 安装没有错误,但是每当我运行任何 Heroku 命令时,它都会吐出几个错误,所有错误都已连接,并谈论失败的“require”。我在代码中查找了它,它说:
require 'readline'
就是这样。
我尝试安装我能找到和想到的 libreadline 的每个变体,但没有一个有任何区别。这里有什么想法吗?
I am trying to get a Ruby on Rails app hosted free somewhere, and Heroku is looking like my last resource. It is supposed to work on Linux, and the gem installs with no errors, but whenever I run any Heroku command it spits out several errors, all connected, and talking about a failed 'require.' I looked it up in the code, and it says:
require 'readline'
That is it.
I have tried to install every variation of libreadline that I can find and think of, but none of it makes any difference. Any ideas here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能是您的系统安装的 Ruby 版本没有构建 readline 支持。如果是这样,那么您可以从源代码重新安装它,并选择正确的
configure
参数来支持readline。这不仅很烦人,而且意味着您必须自己手动维护更新。更好的办法是完全放弃系统 Ruby,转而使用 RVM
安装
libreadline-dev
$ sudo apt-get install libreadline-dev
安装一个版本的ruby(例如1.8.7)
$rvm install 1.8.7
$ rvm --default 1.8.7
在 RVM ruby 下安装 Rails 和 Heroku gems
$ gem install Rails heroku taps ...
# 注意不要使用 sudo!查看您的问题是否仍然存在
如果是这样,请执行以下操作:
$ cd ~/.rvm/src/ruby-1.8.7-p299/ext/readline
$ ruby extconf.rb
$ make
$ make install
It could be that your system installed version of Ruby is not build with readline support. If so then you could reinstall it from source and select the correct
configure
parameters for readline support. That's not only annoying but means you'd have to manually maintain updates yourself.Better still would be to abandon your system Ruby altogether in favor of one installed with RVM
Install
libreadline-dev
$ sudo apt-get install libreadline-dev
Install a version of ruby (e.g. 1.8.7)
$ rvm install 1.8.7
$ rvm --default 1.8.7
Install your rails and Heroku gems under the RVM ruby
$ gem install rails heroku taps ...
# Note no sudo!See if your problem persists
If so, then do this:
$ cd ~/.rvm/src/ruby-1.8.7-p299/ext/readline
$ ruby extconf.rb
$ make
$ make install
Ubuntu 的 ruby-full 包 依赖于 libreadline-ruby 并且应该包含你和你的所有内容它需要。如果您尝试通过安装一堆单独的软件包来安装 ruby,您可能会丢失一些东西。如果是这种情况,请返回并安装 ruby-full。
我有一个 脚本 每当安装时我都会用它来重建 Rails 环境最新的Ubuntu。它还安装了 Heroku(这是我托管应用程序的地方)所需的一切。您可能想看一下它,看看是否有您遗漏的东西。
如果 ruby-full 不能解决你的问题,我会赞同 Bjg 的建议并放弃系统 ruby 而使用 RVM。
Ubuntu's ruby-full package depends on libreadline-ruby and should pull in everything both you and it needs. If you have tried installing ruby by installing a bunch of separate packages you might be missing something. If that's the case go back and install ruby-full.
I have a script I use to rebuild my Rails Environment whenever I install the latest Ubuntu. It installs everything you need for Heroku (which is where I host my apps) as well. You might want to take a peek at it and see if there is anything there that you are missing.
If ruby-full doesn't sort you out, I would second Bjg's advice and ditch the system ruby for RVM.
我让它工作了,但这只是一个黑客。我从安装位置(在某个奇怪的地方)找到了 readline.so 文件,并建立了一个硬链接到 ruby 寻找 readline 的位置,并且它起作用了。不是最佳选择,下次我一定会尝试你们推荐的。谢谢!
I got it to work, but it was rather a hack. I hunted down the readline.so file from where it was installed (in some strange spot) and did a hard link to where ruby was looking for readline, and it worked. Not optimum, and I will definitely try what you guys recommend next time. Thanks!