Tag: heroku

nomethoderror undefined方法’configure’应用程序

我正在努力推动我的应用程序做Heroku。 我创建了运行“heroku create”并顺利运行,它在我们的网站上的应用程序中显示。 当我运行“git push heroku master”时,我收到此错误。 我所看到的与ProjectOne :: Application相同的“NoMethodError:undefined方法`configure”的所有内容都只是进入development.rb文件夹并进行“ProjectOne :: Application.configure do”。 我被困在这里,找不到任何可以帮助我的东西。 据我所知,no方法错误是推送失败的地方,据我所知,到目前为止,我已经修复了问题。 如果错误在代码中的其他地方或我误解了什么,请告诉我! 谢谢 :) C:\Users\Devin Miller\project_one>git push heroku master Warning: Permanently added the RSA host key for IP address ‘50.19.85.132’ to the list of known hosts. Initializing repository, done. Counting objects: 63, done. Delta compression using up to 8 threads. Compressing […]

puma初始化程序不适用于rails 4.2

我之前已经多次安装过puma并且从未遇到过这个问题。 我按照heroku的说明逐字记录。 我在里面创建了一个Procfile : web: bundle exec puma -C config/puma.rb 这是配置文件puma.rb: workers Integer(ENV[‘WEB_CONCURRENCY’] || 2) threads_count = Integer(ENV[‘MAX_THREADS’] || 5) threads threads_count, threads_count preload_app! rackup DefaultRackup port ENV[‘PORT’] || 3000 environment ENV[‘RACK_ENV’] || ‘development’ on_worker_boot do # Worker specific setup for Rails 4.1+ # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot ActiveRecord::Base.establish_connection end 当我通过运行rails s或rails s puma启动服务器时,我得到了 => Booting Puma […]

我无法将我的rails应用程序推送到Heroku /获取’pg’gem安装?

最初我无法将我的rails 4应用程序推送到heroku因为我的数据库是sqlite,所以现在我一直在尝试安装Postgresql gem(’pg’),但我没有运气。 这是我在运行bundle install后在终端中收到的错误消息: checking for pg_config… no No pg_config… trying anyway. If building fails, please try again with –with-pg-config=/path/to/pg_config checking for libpq-fe.h… no Can’t find the ‘libpq-fe.h header *** extconf.rb failed *** 跑完之后 gem install pg -v’0.17.1′–with-pg-config 我在终端中收到此错误: ERROR: While executing gem … (Gem::Requirement::BadRequirementError) Illformed requirement [“0.17.1–with-pg_config”] /project$ gem install pg -v ‘0.17.1’–with-pg-config […]

Heroku app崩溃错误H10 ..无法解决,请帮忙

错误消息: 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/application/finisher.rb:46 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `instance_exec’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `run’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:50:in `run_initializers’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `each’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `run_initializers’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/application.rb:134:in `initialize!’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `method_missing’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `send’ 2011-06-09T18:39:24+00:00 app[web.1]: from /app/config/environment.rb:5 2011-06-09T18:39:24+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ 2011-06-09T18:39:24+00:00 […]

没有运算符匹配给定的名称和参数类型

我设置我的Rails 3.2.x应用程序以使用PostgreSQL HStore但我收到了一个错误。 看起来环境没有拾取hstore扩展。 我已经重新启动了我的机器,检查了数据库扩展等。 当我尝试执行时: User.where(“settings @> (:key => :value)”, :key => “setting_x”, :value => “test”) 我收到一个错误:( @>无法识别,即没有安装扩展名hstore ?) HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. 我的Rails应用程序设置是: Gemfile.rb: gem ‘activerecord-postgres-hstore’ 移民: add_column :users, :settings, :hstore execute “CREATE INDEX CONCURRENTLY users_gin_settings ON users USING […]

在Heroku上渲染大量JSON的有效方法

我用一个端点构建了一个简单的API。 它会抓取文件,目前有大约30,000条记录。 理想情况下,我希望能够通过一次http调用获取JSON中的所有记录。 这是我的Sinatra视图代码: require ‘sinatra’ require ‘json’ require ‘mongoid’ Mongoid.identity_map_enabled = false get ‘/’ do content_type :json Book.all end 我尝试过以下方法:使用multi_json require ‘./require.rb’ require ‘sinatra’ require ‘multi_json’ MultiJson.engine = :yajl Mongoid.identity_map_enabled = false get ‘/’ do content_type :json MultiJson.encode(Book.all) end 这种方法的问题是我得到错误R14(超出内存配额)。 当我尝试使用’oj’gem时,我得到了同样的错误。 我只是将一个很长的Redis字符串连接起来,但Heroku的redis服务是每月30美元,我需要的实例大小(> 10mb)。 我目前的解决方案是使用创建对象的后台任务,并在Mongoid对象大小限制(16mb)附近填充它们充满jsonified对象。 这种方法的问题:渲染仍然需要将近30秒,我必须在接收应用程序上运行后处理才能从对象中正确提取json。 有没有人有更好的想法如何在一次通话中为30k记录渲染json而无需切断Heroku?

在Heroku / Ruby on Rails上找不到PNG

在Heroku上部署后未加载PNG文件! 我正在Heroku上部署一个项目,所有资产都运行得很好,包括图像(jpgs,jpegs和gifs),但PNG文件没有加载! 一般页面显示: GET damainname.com/assets/namespace/my_image-867450b295e2051d381123c16c51548e.png 404 (Not Found) 其他图像文件扩展名(JPG,JPEG和GIF)正常加载。 我在用: Heroku雪松(使用和不使用资产进行测试:在本地进行预编译) ruby 1.9.3p448(2013-06-27修订版41675)[i686-linux] Rails 3.2.11 production.rb: config.action_dispatch.x_sendfile_header = ‘X-Accel-Redirect’ config.serve_static_assets = true config.assets.compress = true config.assets.compile = false config.assets.digest = true application.rb中: config.assets.precompile += [‘application.css’, ‘application.js’, ‘admin.css’, ‘admin.js’] config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif] config.assets.initialize_on_precompile = false

Link_to(image_tag …)在本地工作但在Heroku部署中中断

相当简单的ruby代码在localhost上运行时运行正常,但在向上推送到heroku时会中断。 这里是: “u_profile_img_small”, :title => r.user.name), r.user %> 这是Heroku日志中的错误,指的是上面的link_to行: ActionView :: Template :: Error(错误的参数个数(2个为1))… 是什么赋予了? 有任何想法吗? 谢谢!

类User(TypeError)的超类不匹配?

我和Heroku有困难。 我做了heroku logs并收到错误消息: /app/app/models/user.rb:1:in `’: superclass mismatch for class User (TypeError) /app/app/models/user.rb:1:in `’: superclass mismatch for class User (TypeError) 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:251:in `require’ 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:251:in `block in require’ 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:251:in `require’ 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:359:in `require_or_load’ 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency’ 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- […]

Ruby 2.3 – 向net:http请求添加超时错误和通知

我有一个工作系统来产生错误并将它们发送给Active Admin使用。 例如,在Active admin中,对于CMS的特定页面,页面可能会执行: url_must_be_accessible(“http://www.exmaple.com”, field_url_partner, “URL for the partner”) 这使用下面的代码向Active Admin Editor发送不同类型的错误通知: module UrlHttpResponseHelper def url_must_be_accessible(url, target_field, field_name) if url url_response_code = get_url_http_response(url).code.to_i case url_response_code when -1 # DNS issue; website does not exist; errors.add(target_field, “#{field_name}: DNS Problem -> #{url} website does not exist”) when 200 return when 304 return else errors.add(target_field, “#{field_name}: #{url} […]