production-environment

How to start delayed job workers in production mode

邮差的信 提交于 2019-12-06 01:59:43
问题 I was following railscast for delayed job. Things are working perfectly on my machine. How can start delayed_job workers in production mode? I am using delayed_job gem,(2.1.4) 回答1: RAILS_ENV=production script/delayed_job start For Rails 4 RAILS_ENV=production bin/delayed_job start Solved my problem. It may give you an error that tmp directory doesn't exists. Just create one and run previous command again.. 回答2: You can try to run the following command: RAILS_ENV=production cd ~/path_to_your

Dockerfile production/build/debug/test environment

泪湿孤枕 提交于 2019-12-05 21:03:06
Imagine you have your web application and some workflow executors: http-server (serving pre-build asset files) - production builder (compiling/bundling js/css/html from sources) - deployment/development debugger/builder (building from sources on the fly, add js source maps) - development selenium (running tests) - integration testing How can we construct layered images to get those workflow executors working the most effectively? By effectively I mean "fastest to run and least to write". The answer might be straightforward: just create 4 Dockerfile s one depending on another. You can add a

file_get_contents not working on production server, fine on local

早过忘川 提交于 2019-12-05 14:49:58
I have a PHP script that fetches an image from a remote server so that I can manipulate it using HTML5 canvas API. <?php if ((isset($_GET['url']))) { $url = $_GET['url']; $file_format = pathinfo($url, PATHINFO_EXTENSION); try { header("Content-Type: image/$file_format"); header("Content-disposition: filename=image.$file_format"); $img = file_get_contents($url); echo $img; } catch(Exception $e) { echo $e->getMessage(); } } else die('Unknown request'); ?> A typical request would look like this: fetch_image.php?url=http://example.com/images/image.png Everything works fine on my local server but

Why is XAMPP not suited for production? [closed]

谁说胖子不能爱 提交于 2019-12-05 13:51:33
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I have been running XAMPP on Windows 2008 R2 for many years now, I'm only using Apache, MySql and FileZilla. I have made many custom adjustments and upgraded it serveral times. I have addressed all the security issues I have been able to find. Running as services, the servers

No POST data received Symfony

这一生的挚爱 提交于 2019-12-05 10:23:32
I am struggling with a strange problem since I'm on production on a mutualized server. I have a firewall securing my admin panel matching all the url with /admin/*. On this administration panel, all the POST data that I send do not arrive to the controller. var_dump($this->get('request')->request->all()) gives me an empty array , same thing for : var_dump($_POST) This is very annoying since all my forms and CRUD functionalities do not work anymore... The other pages of my website (not on the admin panel) do work correctly. The Chrome and FireBug console show me that the data is sent the right

Rails namespaced routes work in development but not production

大城市里の小女人 提交于 2019-12-05 09:02:15
I'm trying to nest some routes under the namespace, account. I want user management under account like /account/users and /account/users/5/edit In routes.rb: namespace :account do resources :users do member do put 'generate_api_key' end collection do post 'api_key' end end end My controllers are not namespaced or put them in any different directory. /app /controllers accounts_controller.rb users_controller.rb In my development environment this is working fine, but in production I get 404 responses to any of the /account/users... paths (which, by the way, are all still generated correctly: new

`require': No such file to load — test_helper (LoadError)

牧云@^-^@ 提交于 2019-12-05 07:45:11
I get the following error when I run my Rails application in production mode, but when I run my app in development mode it works fine. Can I use any gems in production mode? `require': No such file to load -- test_helper (LoadError) The following is the full trace of the code: /home/nyros/.rvm/gems/ruby-2.2.0@dfl/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require': No such file to load -- test_helper (LoadError) from /home/nyros/.rvm/gems/ruby-2.2.0@dfl/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require' from /home/nyros/.rvm/gems/ruby

What are the differences between webpack development and production build modes?

家住魔仙堡 提交于 2019-12-05 05:33:50
In Grunt or Gulp, I used to define all the requirements myself, like: stuff should be minified only for production, livereload should be enabled only in dev server. Webpack handles this on its own, via its -d and -p options , that toggle the loaders' minimize mode (most loaders ship with their relevant minifiers), the devtool and similar stuff (I don't know what exactly). Most of that "just works". But on the other hand, there are some libraries that have a development and production mode. For example, React looks at process.NODE_ENV , and if it's production , it disables the propTypes

Using SQLite as production database, bad idea but

China☆狼群 提交于 2019-12-05 03:52:49
We are currently using postgresql for our production database in rails, great database, but I am building the new version of our application around SQLite. Indeed, we don't use advanced functions of postgres like full text search or PL/SQL. Considering SQLite, I love the idea to move the database playing with just one file, its simple integration in a server and in Rails, and the performance seems really good -> Benchmark Our application's traffic is relatively high, we got something like 1 200 000 views/day. So, we make a lot of read from the database, but we make a few writes. What do you

Production compilation with ejected Angular 4 application produces large files

爱⌒轻易说出口 提交于 2019-12-05 03:28:34
ng build --prod Angular CLI command produces highly compressed javascript files in Angular4 application. When the application is ejected using ng eject command, Angular CLI commands are gone and we are left with npm scripts( npm run build command to build the app), but unfortunately that command outputs a non-production build. I tried running webpack -p command directly but the output result files are slightly larger compared to the output of ng build --prod command. How to get a compression equivalent of ng build --prod command but on an ejected application? What command/arguments can produce