草庐IT

springsource-dm-server

全部标签

ruby-on-rails - rails : uninitialized constant just happen on production server

我有一个放在lib/network中的类:moduleNetworkApiclassNetworkProxyendend然后在另一个类中,我引用了这个类:network_proxy=::NetworkApi::NetworkProxy.new(params)一切都在我的开发环境中正常运行,但是当我部署到服务器时,我在上面一行收到错误消息:NameError:uninitializedconstantNetworkApi::NetworkProxy我不知道为什么会出现这个奇怪的错误。请告诉我为什么。 最佳答案 请注意Rails5dis

ruby - Sinatra + Heroku + Datamapper 使用 dm-sqlite-adapter 部署问题

出于某种原因,heroku尝试要求dm-sqlite-adapter,即使它应该在这里使用Postgres。请注意,这发生在我打开任何URL时-而不是在gitpush本身期间。我构建了一个默认的Facebook应用程序。gem文件:source:gemcuttergem"foreman"gem"sinatra"gem"mogli"gem"json"gem"httparty"gem"thin"gem"data_mapper"gem"heroku"group:productiondogem"pg"gem"dm-postgres-adapter"endgroup:development,:t

ruby-on-rails - Rails 和 MQTT : Subscribe to topic in background at server startup?

我想在服务器启动时在我的Rails应用程序中订阅一个mqtt主题,并保持订阅始终处于事件状态和运行状态。我正在使用这个mqttgem进行mqtt通信:https://github.com/njh/ruby-mqtt这是我现在拥有的:在application.rb中:config.after_initializedomqttSub=BackgroundMQTT.newmqttSub.runend后台MQTT类:classMQTTSubscriberdefrunThread.newdoMQTT::Client.connect(:host=>'localhost',:port=>1883,)

ruby - Thin::Server#daemonize 立即退出

我试图制作一个可执行文件,它通过Thin作为守护进程启动Sinatra应用程序。我正在使用此代码通过Sinatra应用程序调用Thin:#!/usr/bin/envrubyrequire'thin'require'app.rb'server=::Thin::Server.new('127.0.0.1',9999,App)server.log_file='tmp/thin.log'server.pid_file='tmp/thin.pid'server.daemonize这是我执行脚本时得到的日志输出:>>WritingPIDtotmp/thin.pid>>Exiting!服务器正常启动

ruby - 安装 dm-mysql-adapter 时出错

我是Ruby的新手。我安装了DataMapper并且正在尝试安装dm-mysql-adapter-1.0.2gem。但是当我尝试安装时,出现以下错误。我正在使用ubuntu操作系统。vinoth@vinoth-laptop:~/Downloads$geminstalldm-mysql-adapter-1.0.2----with-mysql-lib=/usr/lib/mysql----with-mysql-conf=/usr/bin/mysqlWARNING:Installingto~/.gemsince/home/vinoth/gemsand/home/vinoth/gems/bina

ruby - 轨道 4 log4r server.rb :78:in `start' : undefined method `formatter'

我已经研究这个话题太久了,所以我必须发布这个。我有几个运行此设置的应用程序,其中一个在rails启动(railss)时完全失败。它们的配置几乎完全相同,但我似乎无法在这里大海捞针。有没有人对如何找到这个问题有任何指示?设置基于:http://blog.mmlac.com/log4r-for-rails/comment-page-1/#comment-1731当我尝试运行railss时:=>BootingWEBrick=>Rails4.0.0applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Run`railsserver-h`f

ruby-on-rails - Rails 中的推杆 : "Unknown auth_key" - server side not triggering events

我正在尝试将Pusher插入到我已经很晚的Rails应用程序中。客户端工作正常-使用PusherEventCreator触发所需的javascript。但是服务器端不工作:在我的通知Controller中使用以下代码创建要测试的操作:Pusher.trigger('private-4','new_message',{:from=>"christian",:subject=>"hello"})给出这个错误:Pusher::AuthenticationError(Unknownauth_key):app/controllers/notifications_controller.rb:57:

ruby-on-rails - rbenv : bundle: command not found on production server

我正在尝试部署Rails应用程序,但遇到错误DEBUG[1a70ba92]Command:cd/home/deploy/myapp/releases/20140615090226&&(PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATHRBENV_ROOT=~/.rbenvRBENV_VERSION=2.1.2~/.rbenv/bin/rbenvexecbundleinstall--binstubs/home/deploy/myapp/shared/bin--path/home/deploy/myapp/shared/bundle--withou

ruby - gem 安装 dm-postgres-adapter 构建错误

我正在尝试构建dm-postgres-adapter但出现此错误。sudogeminstalldm-postgres-adapterBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingdm-postgres-adapter:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcheckingformain()in-lpq...y

ruby-on-rails - 当我停止 rails server 时,我的 elasticsearch 索引会发生什么?

我对在Rails应用程序中使用Elasticsearch还很陌生,我正在使用耐嚼的gem来实现它。当我通过railss在开发模式下运行我的Rails应用程序时,我然后通过elasticsearch命令运行Elasticsearch并运行rakechewy:reset:all为我的数据创建索引。这样做一切正常,但如果我重新启动服务器,我必须再次运行rakechewy:reset:all命令以重建索引,否则我会收到错误消息。当我重新启动服务器时,索引会发生什么变化?服务器停止时是否销毁?我不是很熟悉Elasticsearch的功能,所以希望有人能对幕后发生的事情有所了解。