• 真够悲催的,我还收藏了你的 blog,现在看不到了,如果你的网站备案过了的话,我可以给你提供我服务器为母鸡的 vps 过,直接给你提供服务器的 ssh

  • Nginx 的 error.log 内容是这样的

    2012/04/05 12:55:57 [error] 2469#0: *3 open() "/home/standme/webroot/demo/public/assets/rails.png" failed (2: No such file or directory), client: 127.0.0.1, server: standme, request: "GET /assets/rails.png HTTP/1.1", host: "standme", referrer: "http://standme/"
    2012/04/05 12:56:14 [error] 2469#0: *3 open() "/home/standme/webroot/demo/public/rails/info/properties" failed (2: No such file or directory), client: 127.0.0.1, server: standme, request: "GET /rails/info/properties HTTP/1.1", host: "standme", referrer: "http://standme/"
    
    
    

    而 rails 的 production.log,内容是这样的:

    
    Started GET "/assets/rails.png" for 127.0.0.1 at 2012-04-04 21:45:43 +0800
    
    ActionController::RoutingError (No route matches [GET] "/assets/rails.png"):
      actionpack (3.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
      actionpack (3.2.2) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
      railties (3.2.2) lib/rails/rack/logger.rb:26:in `call_app'
      railties (3.2.2) lib/rails/rack/logger.rb:16:in `call'
      actionpack (3.2.2) lib/action_dispatch/middleware/request_id.rb:22:in `call'
      rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
      rack (1.4.1) lib/rack/runtime.rb:17:in `call'
      activesupport (3.2.2) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
      rack (1.4.1) lib/rack/lock.rb:15:in `call'
      rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
      rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
      rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
      rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
      rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
      railties (3.2.2) lib/rails/engine.rb:479:in `call'
      railties (3.2.2) lib/rails/application.rb:220:in `call'
      railties (3.2.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
      passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
      passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
      passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
      passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
      <internal:prelude>:10:in `synchronize'
      passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
      passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'
    
    
    
    
    Started GET "/rails/info/properties" for 127.0.0.1 at 2012-04-04 21:45:50 +0800
    
    ActionController::RoutingError (No route matches [GET] "/rails/info/properties"):
      actionpack (3.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
      actionpack (3.2.2) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
      railties (3.2.2) lib/rails/rack/logger.rb:26:in `call_app'
      railties (3.2.2) lib/rails/rack/logger.rb:16:in `call'
      actionpack (3.2.2) lib/action_dispatch/middleware/request_id.rb:22:in `call'
      rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
      rack (1.4.1) lib/rack/runtime.rb:17:in `call'
      activesupport (3.2.2) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
      rack (1.4.1) lib/rack/lock.rb:15:in `call'
      rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
      rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
      rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
      rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
      rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
      railties (3.2.2) lib/rails/engine.rb:479:in `call'
      railties (3.2.2) lib/rails/application.rb:220:in `call'
      railties (3.2.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
      passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
      passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
      passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
      passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
      passenger (3.0.11) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
      <internal:prelude>:10:in `synchronize'
      passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
      passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
      passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
      passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'
    
    
    

    貌似是说路由设置有问题?

    刚开始接触就想把生产环境搞好也是为了增加学习的信心啊,开发环境和服务器部署的生产环境我都能搞好的话,接下来我就专心学习语言了。 :(

  • 顶一下,哪位来帮忙看看吧,服务器环境是 debian 6.0.4,nginx 1.0.14,rails 3.2.2,那个项目就是用 rails new demo 直接生成的,没有做任何修改。

  • redhat-->opensuse-->debian,喜欢之后就没再换过

  • 用 mba 之前一直都是 server 和 desktop 都用 debian,很喜欢 debian,带我学习了 linux,不考虑包管理机制差别的话,OpenSUSE 也很好用啊

  • 找到原因,基本搞定,不管是 autoconf 的错误还是 ruby 的错误,都是因为 mac 没有安装 gcc 编译环境所致,所以安装过 gcc 之后,一切问题将不复存在。

  • #6 楼 @raven 呵呵,缓解一下症状而已,当然,最有效的办法是合理安排休息

  • #3 楼 @huacnlee 你太猛了,自来水里面的有效氯成分可以消毒 ...

  • #18 楼 @welsonla 可怜,我按照你说的这个办法,即便是 rvm get head 仍然没办法安装,郁闷

  • 收藏这篇文章,可怜的是我到现在都还没有把 ruby1.9.3 通过 rvm 安装成功,哎

  • 那为什么之前不少同学给我说他们也是 10.7.3,xcode4.3.1 直接安装没问题呢,莫非是之前他们安装过 gcc,xcode 和 gcc 不能共存吗

  • 原来是这样啊,我设置一下

  • 折腾了 3 个小时,还挺有意思的,呵呵

  • 最后回来报告一下,首先用 gem uninstall rails 把安装了的 rails 删除,然后是 rvm uninstall 1.9.3 把安装了的 ruby-1.9.3-p125 删除,然后手工删除 .rvm 里面 wrappers,src 里面和 ruby-1.9.3-p125 和 gem-1.8.17 有关的文件,这里发现之前使用 sudo 的问题了,直接删除无法删除,必须 sudo 删除才可以,最后按照 huacnlee 重新写的 wiki 安装 rails 的内容,重新安装成功,现在已经可以 localhost:3000 看到了,新手开始学习 rails

  • #17 楼 @huacnlee

    我的 Developer 里面有 Dashcode, Instruments, Quartz Composer, Xcode 不过不管怎么说,我现在 ruby gem rails 都能用了,我都不知道怎么安装成功的,我已经尝试开始学习 rails 了,从这里开始了: http://ihower.tw/rails3/firststep.html

  • #15 楼 @huacnlee

    按照你重新写的教程安装的时候,第二步出错:

    rvm install 1.9.2 --with-readline-dir=$rvm_path/usr
    Fetching yaml-0.1.4.tar.gz to /Users/standme/.rvm/archives
    Extracting yaml-0.1.4.tar.gz to /Users/standme/.rvm/src
    Error running 'tar xmzf /Users/standme/.rvm/archives/yaml-0.1.4.tar.gz -C /Users/standme/.rvm/src ', please read /Users/standme/.rvm/log/ruby-1.9.2-p318/yaml/extract.log
    Configuring yaml in /Users/standme/.rvm/src/yaml-0.1.4.
    Error running ' ./configure --prefix="/Users/standme/.rvm/usr"  --with-readline-dir=/Users/standme/.rvm/usr ', please read /Users/standme/.rvm/log/ruby-1.9.2-p318/yaml/configure.log
    Compiling yaml in /Users/standme/.rvm/src/yaml-0.1.4.
    Installing yaml to /Users/standme/.rvm/usr
    The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
    
    

    不知道是不是那个 --with-gcc=clang 的缘故啊

  • #13 楼 @huacnlee

    应该是我搞错了,我先执行了

    $ rvm pkg install readline
    $ rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
    
    
    

    然后在执行 rvmsudo install 1.9.3 --with-gcc=clang 的时候出错:

    rvmsudo install 1.9.3 --with-gcc=clang
    Password:
    install: 1.9.3: No such file or directory
    rvmsudo install 1.9.3-p125 --with-gcc=clang
    install: 1.9.3-p125: No such file or directory
    
    
    

    我以为是拼写出错了呢,所以弄了个 sudo rvm install 1.9.3 --with-gcc=clang

    那这样的话,还要不要重新再按照教程安装一遍呢 PS:教程貌似描述有些小问题,比如,如果

    叄、用 RVM 安装 Ruby 环境
    $ rvm pkg install readline
    $ rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
    $ rvmsudo install 1.9.3 --with-gcc=clang(Mac OSX下)
    
    

    如果这里的 rvm install 1.9.3 --with-readline-dir=$rvm_path/usr$ rvmsudo install 1.9.3 --with-gcc=clang(Mac OSX下)是并列关系的话,最好放在一行,容易误解

  • #10 楼 @willmouse

    echo $PATH
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/standme/.rvm/bin
    
    

    貌似没有在$PATH 下,看来 sudo 有问题啊

  • 又重复安装了一次,成功了,现在我都不知道是怎么安装成功的了

    #9 楼 @huacnlee 貌似我的 ruby 就是用 rvm 安装的,之前是按照这里的介绍一步步安装的: http://ruby-china.org/wiki/install_ruby_guide

    现在我也不知道哪里出问题了,不知道能不能恢复到初始状态,啥也没装的状态啊,看来要是想学习,最好还是在虚拟机里做

  • @AlphaLiu 不是的,如果不用 sudo 会提示没有权限

  • 不过还是继续杯具:

    rails -v
    Rails is not currently installed on this system. To get the latest version, simply type:
    
        $ sudo gem install rails
    
    You can then rerun your "rails" command.
    
    
    

    真是奇怪了

    之前明明提示已经安装成功了:

    >> sudo gem install rails
    Successfully installed rails-3.2.2
    1 gem installed
    Installing ri documentation for rails-3.2.2...
    Installing RDoc documentation for rails-3.2.2...
    
    
  • @AlphaLiu 真神了,你怎么看出来是网络的问题呢? 我更换了 taobao 的镜像,安装完成了

  • 之前我曾经有个 MBP 那时候是 OS X10.7.2,貌似没有出现这个问题,按照这里的介绍就直接安装成功了: http://ihower.tw/rails3/installation.html

    现在换了个 MBA,新系统,竟然出错,郁闷啊

  • 求一个摄影社区的程序 at 2012年03月11日

    @fredwu 听沧蓝的,准备为了这个项目就学习

    PS 你的网站貌似打不开了

  • 求一个摄影社区的程序 at 2012年03月11日

    @tassandar 我纯粹就是有这样一个想法,你没看其实这个需求早在 2011 年 7 月就写了,可怜的是我不懂技术,难以实现啊

  • 求一个摄影社区的程序 at 2012年03月11日

    杯具,让大家见笑了,看来我的想法太多了

    @fredwu 沧蓝就莫笑了,呵呵