我正在尝试在我的Apache(2.2.3)networking服务器上安装eruby或erubis,所以我可以在.rhtml文件上运行内联ruby代码 – 我不太擅长命令行和shell脚本,我正在尝试和尝试学习新的东西,但是我不能为了我的生活得到任何正常工作。 我安装了Ruby(v 1.9.2p290),我知道它正常工作,因为我可以通过shell运行一些简单的rubyexpression式,例如: #ruby #puts "Hello World" ^D Hello, World! 我有Ruby Gem(v 1.8.23)的工作。 我也能够成功安装Rails(v 3.2.3)(通过gem),并按照guide.rubyonrails.org/getting_started.html中的指南获得了一个简单的rails应用程序 而且我并不是试图得到erubis(起初),现在eruby运行,所以我可以玩一些简单的内联ruby(ala PHP,我很熟悉) – 我安装了Erubis(通过gems)并运行v 2.7.0。 我查看了遍布erubis网站的更详细的说明,我觉得我已经做了一切必要的工作,但是它并没有parsingrubyexpression式。 我根据我在googlefind的几篇文章以及http://www.ruby-doc.org/docs/ProgrammingRuby/html/web.html (我觉得实际上不会为erubis做任何事情,但是我仍然尝试了…) 我张贴在SO(因为它总是帮助我相对较快,但我对这个问题没有任何反应),现在我试图安装eruby。 我下载并解压tar到我的cgi-bin并运行# ./configure.rb并得到了关于ftools的错误 – 我做了一些研究,发现ftools在Ruby 1.9中被弃用,并被fileutils取代。 我试图做一些replace,并提出更多的错误。 我在死路一条,我找不到很多关于这方面的信息,但我觉得我必须错过一些非常简单的事情。 有一个更简单的替代scheme来满足我的需求吗? 任何帮助或信息非常感谢!
我试图configurationLighttpd使用FastCGI运行Redmine。 我已经将下面的代码添加到我的标准lighttpd.conf : $HTTP["host"] =~ "^foo.bar.com$" { server.document-root = "/usr/share/redmine/public/" index-file.names += ( "dispatch.fcgi" ) #dispatch.fcgi if rails specified server.error-handler-404 = "/dispatch.fcgi" #too fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/var/run/lighttpd/rails-fastcgi.sock", "bin-path" => "/usr/share/redmine/public/dispatch.fcgi" ) ) ) } 当我尝试启动lighttpd服务器时,我在错误日志中得到以下内容: May 11 10:24:05 ohio lighttpd[5527]: (log.c.166) server started May 11 10:24:05 ohio […]
根据Unicorn文档,Rails应用程序和其他Rack应用程序有不同的二进制文件: non-Rails Rack applications In APP_ROOT, run: unicorn for Rails applications (should work for all 1.2 or later versions) In RAILS_ROOT, run: unicorn_rails 他们似乎也采取相同的命令行参数。 但Railsbuild立在机架之上,所以我不明白为什么这种二分法是必需的。 有什么原因,你不能只使用unicorn的Rails应用程序?
我一直在使用Monit监视我的瘦服务器,一切正常,直到我将我的Rails版本从2.3.4升级到2.3.14。 现在当我尝试使用monit来启动Thin时,它给了我一个无法解释的gem错误: Missing the Rails 2.3.14 gem. Please `gem install -v=2.3.14 rails` 我认为这可能是一个GEM PATH问题,也尝试在启动命令中设置GEM_HOME和PATHvariables: check process thin3001 with pidfile /home/blahblah/apps/Vocab/shared/pids/thin.3001.pid start program = "/usr/bin/env PATH=/usr/lib/ruby/gems/1.8/gems GEM_HOME=/usr/lib/ruby/gems/1.8/gems /usr/bin/ruby /usr/bin/thin -C /etc/thin/vocab.yml start -o 3001" stop program = "/usr/bin/ruby /usr/bin/thin -C /etc/thin/vocab.yml stop -o 3001" if totalmem > 150.0 MB for 5 cycles then restart group thin […]
我刚刚使用Rackconnectbuild立了RHEL 6.1 Rackspace云主机和RHEL 6.2专用主机的混合体。 在RHEL 6.2专用主机上运行Redis 2.4.16的情况下,我在Rails 3.2.8应用程序中遇到了间歇性的Redis超时。 没有networking延迟或数据包丢失。 此外,我们的云或专用服务器上的任何接口或Rackspace的托pipe防火墙上都没有错误。 当Redis超时时,即使设置为执行debugging日志logging,redis中也没有logging。 我们收到的唯一错误是Airbrake说有一个Redis超时。 networking拓扑结构: RHEL 6.1 cloud hosts <–> Alert logic IDS <–> Cisco ASA 5510 <–> RHEL 6.2 dedicated hosts (web nodes) (two way NAT) (db hosts running redis) 从数据库主机到networking主机: 64 bytes from 10.181.230.180: icmp_seq=998 ttl=64 time=0.520 ms 64 bytes from 10.181.230.180: icmp_seq=999 ttl=64 time=0.579 […]
在我的Linux服务器上,我跑了: sudo thin start -p 80 -d 现在我想重启服务器。 麻烦的是,我似乎无法让旧的程序杀死它。 我试过了: netstat -anp 但是我在80号端口看到的是这样的: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN – 所以,它没有给我一个PID来杀死… 我尝试了pgrep -l thin但是没有给我什么。 同时pgrep -l ruby让我像6个进程运行。 我真的不明白为什么多个ruby线程将运行,或者我需要杀死哪一个线程… 如何杀死/重启瘦守护程序?
当我运行bundle (或bundle exec foo )时,大约有50%的时间出现如下错误: > bundle /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': No such file or directory – /usr/local/lib/?y (Errno::ENOENT) from /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler.rb:8:in `<top (required)>' from /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /usr/local/Cellar/ruby/1.9.3-p374/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/bin/bundle:2:in `<top (required)>' from /usr/local/bin/bundle:23:in `load' from /usr/local/bin/bundle:23:in `<main>' 对我来说,它在构build需求path时闻起来像是内存腐败,但是我不知道为什么只有在使用Bundler而不是使用vanilla Ruby的时候会发生这种情况。 我知道,Bundler补丁Kernel.require但错误(按照上面的轨迹)似乎发生在path交给该方法之前。 我有的版本的软件: > ruby –version ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.0] > gem […]
我想完全删除我的Ruby和Rails的安装。 使用apt-get remove ruby1.9.1卸载Ruby后, apt-get remove ruby1.9.1我看到从“/ usr / bin”中的ruby , rake和irb等所有Ruby的东西都被删除了,但是这些gem仍然在这里: /var/lib/gems/1.9.1/gems 什么是最好的方法来消除这些? 再一次,我想卸载一切,所以我可以再次尝试这个安装。 rm -r /var/lib/gems/ ???
我试图通过使用vagrant自动化验收testing带来亚马逊的EC2服务的机器,所以我添加了虚拟框,并从Github复制Vagrantfile,但是当我尝试运行vagrant up –provider=aws我得到输出下面:我对ruby相当陌生,所以我不确定到底发生了什么问题。 将机器“默认”与“aws”供应商… [默认]警告! AWS提供商不支持任何stream量 高级networkingconfiguration( config.vm.network )。 他们 会被默默的忽略。 [默认]使用以下设置启动实例… [默认] – types:m1.small [默认] – AMI:ami-5344d263 [default] – Region:us-east-1 [默认] – 密钥对:vagrant-keypair /home/vagrant/.vagrant.d/gems/gems/excon-0.25.0/lib/excon/middlewares/expects.rb:10:in response_call': Expected(200) <=> Actual(400 Bad Request) (Excon::Errors::BadRequest) from /home/vagrant/.vagrant.d/gems/gems/excon-0.25.0/lib/excon/connection.rb:353:in response from /home/vagrant/.vagrant .d / gems / gems / excon-0.25.0 / lib / excon / connection.rb:247:in request' from /home/vagrant/.vagrant.d/gems/gems/fog-1.10.1/lib/fog/core/connection.rb:21:in /home/vagrant/.vagrant.d/gems/gems/fog-1.10.1/lib/fog/aws/compute.rb:384:in _request' […]
我在Ubuntu 12.04.2 LTS中安装paperclip gem时出现问题。 Activesupport抱怨说,它需要ruby 1.9.3但我已经安装。 root@Ubuntu-1204-precise-32-minimal /home/…/releases/current # gem install paperclip -v '3.3.1' ERROR: Error installing paperclip: activesupport requires Ruby version >= 1.9.3. root@Ubuntu-1204-precise-32-minimal /home/…/releases/current # ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]