新手问题 有人部署过<web application>书中的那个 holla 的代码吗?

zhkzyth · 2012年08月05日 · 最后由 zhkzyth 回复于 2012年08月05日 · 4010 次阅读

断断续续整了一个礼拜,要给跪下了=.=...

项目地址:https://github.com/maccman/holla

本来是打算好好看下 spine 代码,顺便学下 ruby,谁知道部署都弄不好=.=....我 bundle install 的时候,老是去到装 eventmachine 这个 gem 的时候会出现错误,求大虾指点=.=

error msg: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from extconf.rb:1:in `'

Gem files will remain installed in /home/zhkzyth/.bundler/tmp/6254/gems/eventmachine-0.12.10 for inspection. Results logged to /home/zhkzyth/.bundler/tmp/6254/gems/eventmachine-0.12.10/ext/gem_make.out An error occured while installing eventmachine (0.12.10), and Bundler cannot continue. Make sure that gem install eventmachine -v '0.12.10' succeeds before bundling.

好吧,代码都凌乱了

sudo apt-get install ruby-dev

好像还是不行,@Rei .....是我的 rail 版本过高么,我看错误日志那里提示除了在安装 eventmachine 这个 gem 出现错误之外,还因为“require': cannot load such file -- mkmf (LoadError)”...

mkmf 是因为 ruby 里面负责编译 c 扩展的模块没装上,其实本来 ruby 都有的,不过 ubuntu 把 ruby 拆了几个包。

搜了一下,你装的 ruby 1.9,应该是 sudo apt-get install ruby1.9.1-dev

http://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror

推荐用 rvm 安装 ruby,ubuntu 的 rubygems 锁了版本号,以后也会遇到问题。

真奇怪,我明明装的是 ruby1.9.1-dev 版的,下面安装 linecache19 -v '0.5.11'的时候就报错了,错误的 log 在下面,引用的是“--ruby=/usr/bin/ruby1.8”的版本.....=.=....@Rei 大神,这个怎么搞

Building native extensions. This could take a while... ERROR: Error installing linecache19: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

坑爹,我看还是直接用 rvm 好了

#5 楼 @zhkzyth 先换用 rvm 吧,用了 rvm 之后就没弄过 ubuntu 的 Ruby 了。

@Rei ,我用了 rvm 了,不过在安装 rubygems-1.8.24 的时候卡了好久,log 如下:

curl: (28) connect() timed out! There was an error, please check /home/zhkzyth/.rvm/log/ruby-1.9.3-p194/*.log. Next we'll try to fetch via http. Trying ftp:// URL instead.

又是万能的墙么?

@Rei 那么在 bash/shell 里面跑下 export http_proxy=“....”的话应该就可以走 proxy 去下载了吧?

换 fedora 吧。在包的质量上,有保证。

好主意,不过我现在是在做前端方面的工作,挂个 ubuntu 在虚拟机跑着的=.=....fedora 久仰了,不过木有尝试过....有空去了解下,谢谢@xds2000 拉...

@Rei ,墙的问题,新手区有..http://ruby-china.org/topics/4621

给其他想装的 Ruby 的童鞋,先用下 rvm(r=Ruby ,v =version ,m=management ),别一上来就来个 apt-get...在 ubuntu 那个悲催....可以参考社区的 wiki,http://ruby-china.org/wiki...写得真好!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号