environment

Getting config.eager_load is set to nil while trying to run rails c in test

非 Y 不嫁゛ 提交于 2019-12-08 14:29:57
问题 I'm trying to run the rails ( 4.1.2 ) console rails c RAILS_ENV=test And I'm getting this: > config.eager_load is set to nil. Please update your > config/environments/*.rb files accordingly: > > * development - set it to false * test - set it to false (unless > you use a tool that preloads your test environment) * production - > set it to true > > /Users/xxxxxx/.rvm/gems/ruby-2.2.2/gems/activerecord-4.1.12/lib/active_record/connection_adapters/connection_specification.rb:257:in > `resolve

Hudson ERROR: M2_HOME is set to an invalid directory

落花浮王杯 提交于 2019-12-08 07:54:10
问题 I am using a computer with Windows 7, and I have Hudson installed on it. I have had this installation for a while, and it has been working fine up till now. Something has changed. Now, whenever I try to build a project, after successfully checking out the project from SVN, it fails with this message: ERROR: M2_HOME is set to an invalid directory. M2_HOME = "C:\Build\Hudson\.hudson\jobs\Score_Plugin\workspace\.." Please set the M2_HOME variable in your environment to match the location of the

Changing the functional/global environment in R

旧城冷巷雨未停 提交于 2019-12-08 05:30:33
问题 Is there any way to change the set the working environment or workspace in R to a defined environment? I'd like to call the variables in an environment without constantly referring to the environment. I understand that the attach function can be used to access the variable in this manner, but any variables created don't get placed back in the attached environment. The goal is to have all the functions take place in the other environment. For example: original.env <- .GlobalEnv other.env <-

In GDB, how can I set 'exec-wrapper env' to multiple environmental variables?

核能气质少年 提交于 2019-12-07 19:02:26
问题 In GDB you can set the environmental variables for a process using set exec-wrapper env 'MYENVVAR=...' . This works great, but I'm not sure how to set multiple ones - is there some sort of delimiter you have to use? I'd like to set both LD_PRELOAD and LD_LIBRARY_PATH for a process. How would I do this? 回答1: You can use set exec-wrapper env VAR1=val1 VAR2=val2 to set multiple environment variables. The values should be appropriately quoted for your shell, so putting single quotes around them

efficiently move environment from inside function to global environment

流过昼夜 提交于 2019-12-07 04:56:20
问题 I have a function that creates an environment within it and i wish to assign that environment to the global environment. At present i do this by assigning the environment to globalenv() as the final step -- as follows: funfun <- function(inc = 1){ dataEnv <- new.env() dataEnv$d1 <- 1 + inc dataEnv$d2 <- 2 + inc dataEnv$d3 <- 2 + inc assign('dataEnv', dataEnv, envir = globalenv()) } It feels like i should be able to do something to make dataEnv persisit when the function funfun ends (to save

Redirect all outgoing emails to single address for testing

北城以北 提交于 2019-12-07 03:46:11
问题 In Ruby on Rails, I'm in a situation where I'd like my application (in a particular testing environment) to intercept all outgoing emails generated by the application and instead send them to a different, testing address (maybe also modifying the body to say "Initially sent to: ..."). I see ActionMailer has some hooks to observe or intercept mail, but I don't want to spin my own solution if there's an easier way to do this. Suggestions? 回答1: We're using the sanitize_email gem with much

jinja2 Custom filter “TemplateAssertionError: no filter named 'format_number'”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 02:54:32
问题 I'm getting the " TemplateAssertionError: no filter named 'format_number' " error, when trying to register a custom filter on the template environment by updating the filters dict on the environment. In my module, I have imported environment module as follows: from jinja2 import environment In my class I defined the following method: class DashboardHandler(SecurePageHandler): def format_number(number): s = '%d' % number groups = [] while s and s[-1].isdigit(): groups.append(s[-3:]) s = s[:-3]

R - evaluate nested function call in a deserialized environment

拈花ヽ惹草 提交于 2019-12-07 01:54:28
I am trying to run an already existing chunk of R code in a sandbox-ed fashion, by saving the global environment (containing functions and data) to a file, then loading it into a new environment (not the global environment) and evaluating a function call within that environment. However, I'm running into trouble with functions calling other functions in the environment. Here's an example: f1 <- function(x) x*2 f2 <- function(y) f1(y) + 1 save(list=ls(), file="env.RData") rm(list=ls()) jobenv <- new.env(parent=globalenv()) load("env.RData", envir=jobenv) expr <- quote(f2(3)) eval(expr, envir

iPhone - Switching between local and production environment settings

筅森魡賤 提交于 2019-12-07 01:43:45
问题 I am developing an iPhone app which uses a server somewhere to fetch its data. Somewhere in the app's source code I hardcoded the URL to use to connect to. This is fine, except that I don't always want to test using a production server! I don't want to mess with live data, just to test something locally. So I set up a local version of that same server. But in order to make the iPhone app use that server is to change the hardcoded URL in the source code. This is a little bit of a pain in the

Why are modules in PYTHONPATH not found when the containing directory is part of PYTHONPATH and file exists?

我怕爱的太早我们不能终老 提交于 2019-12-06 22:15:36
问题 I have the following situation (verfication through commands below): existing python script file in directory x existing python cat __init__.py file in x x added to PYTHONPATH variable availble for both logged in user and sudo and I want to invoke ~/test.py with #!/usr/bin/python import sys;print sys.path; import mount_utils print "Hello World!" with sudo python ~/test.py which causes Traceback (most recent call last): File "/home/richter/test.py", line 3, in <module> import mount_utils