w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
"bundle exec rake db:test:prepare" vs "bundle exec rake db:populate"
The first two commands execute on your development database by default, unless you specified a RAILS_ENV. rake db:test:prepare performs all the migrations on the test database. A more detailed explanation can be found here.

Categories : Ruby On Rails

You have already activated rake 0.9.6, but your Gemfile requires rake 10.1.0. Using bundle exec may solve this
At the root of project, do: gem list rake You will see probably more than one version. If so, then remove the version you don't need (i.e. 0.9.6) by command: gem uninstall rake it will ask which version to remove. Or try doing bundle update rake

Categories : Ruby

bundle exec rake db:create:all, errors caused by 2 different versions of rake gem, not sure where to go from here
I don't think it's the multiple versions of rake. The bundle exec bit should do the right thing. Are you missing the /config/boot.rb file referred to at /config/application.rb:1?

Categories : Ruby On Rails

Bundle Exec Rake DB Migrate
I came across this problem when first starting out. I always solved it by just reseting the database. You already have a column created so reseting it will probably work. run bundle exec rake db:reset than bundle exec rake db:create and finally bundle exec rake db:migrate

Categories : SQL

Issue with bundle exec rake db:migrate
have you done gem install rake on your command line or edited the gemfile manually? In either case, "rake","=0.8.7" doesn't look right to me...shouldn't it be written as: gem "rake","~> 0.8.7"

Categories : Ruby On Rails

Bundle Exec Rake DB Migrate Error
The SQlite error is showing that you already create email field to users table. ADD "email" varchar(255) DEFAULT '' NOT NULL. so try to use "different column name" or remove old migration. def change remove_column :users, :email, <type> end after that use this migration def up add_column :users, :email, :string end def down remove_column :users, :email, :string end

Categories : Sqlite

Why bundle exec rake does not run to proper version of ruby
There are a variety of pieces that could be in play. The first is that it could be a conflict between your Ruby version management tools and your global gems. Meaning, I suppose it is possible that you only have a Rake version that can work on Ruby 1.9.1 that is in your global set. So when you fire up Rake it is forced to run in Ruby 1.9.1. What you may want to do is create a directory specific gemset. If you're using RVM you can see the documentation on how to do that by looking at their Gemset documentation. Once that is in place with the Ruby version you want to test with, then do a gem install of Rake at the version that will work with that Ruby version. At that point you should find that the Ruby version being used to run Rake in that directory will be the same as the version you hav

Categories : Ruby

Rails CSS not rendering with Heroku (already did RAILS_ENV=production bundle exec rake assets:precompile)
Check the following files and make sure they have (at least) these lines: assets/stylesheets/application.css /* ... *= require_self *= require_tree . */ config/application.rb config.assets.enabled = true config.assets.precompile += %w( *.css *.js ) config/environments/production.rb config.serve_static_assets = true Gemfile (don't forget to re-run bundle install) gem 'rails_12factor' Sources: The Asset Pipeline Guide Heroku Rails integration

Categories : Ruby On Rails

segmentation fault while running the programme
char buf[MAX_LENTHS]; You have not defined the array size, i. e. MAX_LENTHS should be defined like #define MAX_LENTHS 25 And as Paul R says in his comment you also need to initialize your array of character pointers char *options[MAX_ORGS]; with something .

Categories : C

Python crashing when running two commands (Segmentation Fault: 11)
Running the following command on terminal, I got it working (Considering you're using python 3.3. Otherwise, change for the version you want): cd /Library/Frameworks/Python.framework/Versions/3.3 cd ./lib/python3.3/lib-dynload sudo mv readline.so readline.so.disabled

Categories : Python

Error message when running "Rails S" & "$ bundle exec rspec spec/requests/static_pages_spec.rb"
The top line of the stack trace: /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-3.2.1 /lib/action_dispatch/routing/mapper.rb:258:in `merge': no implicit conversion of String into Hash (TypeError) This makes me think you have something invalid in your routes. Does anything work?

Categories : Ruby On Rails

Rails + Rake: How to simulate running of rake task to see if it works?
Yes you can actually run bundle exec rake COMMAND -n Having a look at rakes help we can see it here. # rake --help --dry-run Do a dry run without executing actions.

Categories : Ruby On Rails

Not able to run rake and bundle
Did you close and reopen your terminal window or try opening a new one? You might have environment variables still pointing to RVM. What happens when you run rvm info? Are the RVM initializations still in your ~/.bash_profile or ~/.bashrc files?

Categories : Ruby

bundle binstubs vs rake
Yes. As an example, when you install gems locally within your rails app using Gemfile and bundle install, you normally need to do a bundle exec before running tasks, so as to resolve ruby gems dependecies from the app directory, not from installed otherwise (using gem install <gemname>). With binstubs, you don't need to do that. Example: bundle exec rake RAILS_ENV=production onetime:generate_report without binstubs and rake RAILS_ENV=production onetime:generate_report with binstubs

Categories : Ruby On Rails

Php-zmq segmentation fault
You should setSockOpt() before connect(), but I don't know if the Segmentation fault related to this. Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE and ZMQ_LINGER, only take effect for subsequent socket bind/connects. http://api.zeromq.org/2-2:zmq-setsockopt

Categories : PHP

Segmentation Fault - GNU C
The line the_exp->expr->intgr = intgr; is writing to an uninitialised pointer. You've allocated memory for the_exp but not the_exp->expr. The easiest fix might be to change Expression to have u_expr by value rather than pointer typedef struct { expr_type type; u_expr expr; int exec_count; } Expression; If you can't do this, IntegerLiteral_init could be changed to allocate memory for the_exp->expr Expression *IntegerLiteral_init(int intgr) { Expression *the_exp = safe_alloc(sizeof(Expression)); the_exp->type = expr_IntegerLiteral; the_exp->expr = safe_alloc(sizeof(*the_exp->expr)); the_exp->expr->intgr = intgr; the_exp->exec_count = 0; return the_exp; } If you try the latter approach, make sure to also free the_exp

Categories : C

Segmentation fault?
What value of board_width? If this is 3, then you forgot that indexing starting from 0 and maximum available index is 2, so condition in checkbound function must be: if(row < 0 || row >= board_width || col < 0 || col >= board_width)

Categories : C++

Segmentation fault comes and goes
It says it is a bug, and you are using an outdated patchlevel from ruby. Try to update to the latest patch level (I believe ruby-1.9.3-p429), and if it persists and you really trust your hardware, you will have to open a bug for ruby. Could be computer memory issue too, I suppose it is better try your code in other box, just to be sure.

Categories : Ruby On Rails

Segmentation Fault !!!!! Help me
When you call agregarHilo, a Hilo object is constructed which starts a thread. As agregarHilo returns immediately, that object is destroyed, and when the thread tries to access it, it accesses a destroyed object. You need to ensure that the Hilo object outlives the thread, possibly by keeping track of them in your Operaciones instance in a collection of some sort, like an std::vector.

Categories : C++

"You have already activated" message even when using bundle exec
you need to follow the instructions, if the installer tells there are incompatible settings then you need to clear them, usually this should do just fine: rm -f ~/.gemrc a common solution to this is also disabling docs (not needed on server and not many users use them locally anyway): echo 'gem: --no-ri --no-rdoc' > ~/.gemrc Both will get rid of the old ~/.gemrc which was forcing gemhome / gempath - this is required as this variables are controled with RVM via environment variables GEM_HOME / GEM_PATH. After ~/.gemrc is fixed run: rvm use 1.9.3 --default --install it will make sure ruby is installed, set as default and properly loaded into current environment.

Categories : Ruby On Rails

Why does "bundle exec" eat the parameters I pass in?
Inspecting from source of bundler, it is default behavior to pass all the parameters after bundle exec to Kernel.exec, so the --verbose parameters will be passed to your command, not bundle. bundle exec my_command run --verbose will run the following under the context of bundle Kernel.exec('my_command', 'run', '--verbose') and bundle exec -- my_command run --verbose results in an error because no command/script is named --. Check the test case here: #!/usr/bin/env ruby # coding: utf-8 # file: test.rb p ARGV test: $ bundle exec ruby test.rb --verbose --arg1 ["--verbose", "--arg1"]

Categories : Ruby

C++11 async segmentation fault
I've tested the code with clang 3.2(apple llvm 4.2) and it runs just fine. it returns In main 3 edit: Also other people tested with gcc 4.8.1 and it works. The most probable issue is that you are linking to the default pthread library instead of the one that comes with gcc 4.8.1 from macports

Categories : Multithreading

How to correct a segmentation fault?
You don't appear to have any value inventory to return from Product::get_inventory(). I would think that either this wouldn't compile, or you have some code that you haven't shown that is relevant. Most likely, the latter is the case, and the variable inventory is not yet initialized at the time that it is returned.

Categories : C++

segmentation fault with char*
The main problem with your code is that you have absolutely no error checking. Read up on the functions you're using so that you can tell if they're returning successfully or not. Also, you're usage of memory is completely backwards. Malloc is mainly used when you don't know the size of the memory ahead of time. You should be using it like this: char nombrearchivo[50]; // instead of malloc (sizeof (char) * 50); char * cadena = malloc (strlen(nombre) + 1); Your lack of error checking starts here: red = strtok(NULL, ".").Check to make sure that the call is successful or not by doing this: if (nombrearchivo){ red = strtok (NULL, "."); codigored = atoi (red); } Another possible cause is atoi. Are you checking that red contains a null terminated string of just numbers? Are you

Categories : C

Segmentation fault which accessing a map c++
for(it=mos.begin();it!=mos.end();it++); // ^ Your loop has empty body. Some tips: Enable warnings: warning: for loop has empty body [-Wempty-body] Declare variables only when they are needed: for(auto it = mos.begin(); it != mos.end(); it++); { cout << (*it).first << endl; } This code will cause a compile time error: error: use of undeclared identifier 'it'

Categories : C++

C++ Lambda segmentation fault
As mentioned by @Arkadiy in the comments, a stateful lambda does not decay to a function pointer. The fix is to write your traverseInOrder as a template that takes a callable object template<class Func> void traverseInOrder(Func visitFunc)) { traverseInOrder(visitFunc, root); } Alternatively, you could be more type-safe and give it a signature that takes a std::function that returns void and takes a node<T>* void traverseInOrder(std::function<void(node<T>*)> visitFunc)) { traverseInOrder(visitFunc, root); }

Categories : C++

segmentation fault 11 in apache
This question also refers to the zend_mm_heap corrupted error: What does "zend_mm_heap corrupted" mean . It suggest that you increment the output_buffering= value in the php.ini. You might give that a shot. If that doesn't help, do you have some kind of statistics about memory usage of the server. Might it be that memory is full? Also is there anything to be found in the PHP error log from around the time that these errors occur?

Categories : Wordpress

Segmentation fault: 11 on c program
Here's a simple adaptation of your code, with error checking on the scanf() calls: #include <stdio.h> #include <stdlib.h> static void err_exit(const char *msg); int main(void) { int nAlunos, nNotas; if (scanf("%d", &nAlunos) != 1 || scanf("%d", &nNotas) != 1) err_exit("failed to read dimensions"); char listaNomes[nAlunos][16]; float listaNotas[nAlunos][nNotas+1]; int i, k; for (i = 0; i < nAlunos; i++) { if (scanf("%s", listaNomes[i]) != 1) err_exit("failed to read name"); for (k = 1; k <= nNotas; k++) { if (scanf("%f", &listaNotas[i][k]) != 1) err_exit("failed to read grade"); } } for (i = 0; i < nAlunos; i++) { printf("%s

Categories : C

IZ3 cpp_example segmentation fault
It's unsat_core_example3() that is crashing. I tracked down the problem to expr_substitution::find() proofs_enabled() == false there but in rewriter_tpl<Config>::visit(expr * t, unsigned max_depth), ProofGen == true, but from the call 'm_cfg.get_subst(t, new_t, new_t_pr)', new_t_pr is uninitialized. What valgrind has to say: ==26885== Conditional jump or move depends on uninitialised value(s) ==26885== at 0x4C21802: bool rewriter_tpl<th_rewriter_cfg>::visit<true>(expr*, unsigned int) (ast.h:1562) ==26885== by 0x4C21A77: void rewriter_tpl<th_rewriter_cfg>::process_app<true>(app*, rewriter_core::frame&) (rewriter_def.h:179) ==26885== by 0x4C23303: void rewriter_tpl<th_rewriter_cfg>::resume_core<true>(obj_ref<expr, ast_manager>&

Categories : C++

debugging segmentation fault
One way to do it - create a log file, print value of pimpl/some variable belonging to pimpl before pimpl->hbar(...);, and inside pimpl->hbar(...); Compare output from different compilers, try narrow down the problem that way adding more output to log file as you start seeing divergence...

Categories : C++

C Segmentation fault using strtok
You are using output as a char * in while (output != NULL){ and output = strtok(NULL, " "); But output is declared as simple char char* words, output; Take a look to Question 1.5 of C-FAQ

Categories : C

Android Segmentation Fault
From the logs I could see that you are using Android 2.3 (Gingerbread). actually there is a bug in this version during garbage collection. Thats why I think there is android native library crash. Please see similar problem here https://groups.google.com/forum/#!topic/android-ndk/k6rWjsrs_z0 Work around - (taken from the above link): The work around is to store object array elements atomically. In the Bionic C library, the bcopy routine is implemented separately from memmove and, quite fortuitously, moves word sized values atomically. This commit switches System.arraycopy to using bcopy instead of memmove.

Categories : Java

C Segmentation Fault using Strcmp
The problem with your code was very likely identified by your compiler's warnings: you should see a lot of them, telling you that you are passing a char to a function expecting a char*. The strcmp function expects C strings, not simply char*, meaning that there should be a null terminator after the last character of the string. That's why you'd get a failure even if you passed a pointer to an individual character. If you would like to compare individual characters, all you need is a plain ==: if(test_string[x] != '[') ...

Categories : C

Python Segmentation fault: 11 on OSX
Is there a reason you did not just use the official version, which is thoroughly tested via the built in test suite before being released? See: http://www.python.org/download/releases/2.7.5/ or http://www.python.org/download/releases/3.3.2/ and download the appropriate dmg. If you still have problems with the official version, you are likely either doing something very bad (stack overflow or memory corruption using something like ctypes), you have a hardware problem, or you have corrupt software on your system.

Categories : Python

How do I debug this segmentation fault?
Here: void capitalize(char *s){ while(*s != '') if(islower(*s)) *(s++) += ('a' - 'A'); } you should increment s even if it is not lower. Also a strupr function exists. Moreover in main you should check argc to know how many parameters there are. You cannot assume argv[argc] == 0.

Categories : C

inet_ntoa() segmentation fault on OSX
I'm going to guess that your OSX system is 64-bit while your Linux system is 32-bit. An undeclared function is assumed to return an integer. If the 64-bit pointer decays to a 32-bit integer which is dereferenced as a pointer, you will lively get a seg fault.

Categories : C

Segmentation fault - what is the reason
As I commented above, the problem is that the process is being compiled as a 64-bit process. This is a problem for two reasons: x64-linux uses a different system call table than x86-linux. Since you aren't calling a direct system call, this probably isn't the mistake - but it's something to be aware of. For example, write isn't 0x04 in x64-linux, it is 0x01. (See this table for x64-linux system call numbers). Obviously, x64-linux has larger pointer sizes. So when a 32 bit address is loaded, there is a random 32-bit upper-half of that address that may point to anywhere. This also affects values in a function's stack (they call contain 8-byte offsets, instead of 4) This is mostly likely what was causing the problem in this code.

Categories : C

mysterious c++ segmentation fault
As you want to print the integer and the new line into the file, and not to "add" them, this line resultsfile << i + " "; should be resultsfile << i << " "; Next time, compile your program with -g option and run it inside gdb. After running the program, and receiving segfault, type backtrace, so you can see where your code broke. This way segmentation fault will not be so mysterious.

Categories : C++

C++ Segmentation fault in game
If that's the destructor for gamestatemanager, you're not supposed to call it explicitly. It gets called when the object system cleans up your object. If it's created as a local variable with something like: Gamestatemanager gamestatemanager; then it will be cleaned up when it goes out of scope. If it's allocated with new, you should delete it, at which point it will get cleaned up. What you're probably finding here is that you're calling the destructor yourself, then it's being called again when the object goes out of scope. That's unlikely to end well :-)

Categories : C++

Segmentation fault in the code
When you declare a local variable, it's contents is undefined. So when you declare an array of pointers, the pointers in the array will be pointing to seemingly random locations. Using an uninitialized pointer is undefined behavior. Undefined behavior may lead to a crash, or it may seemingly work, but you can't say beforehand what will happen. There are two solutions to your problem: Allocate memory for ptr[i] (even when i is zero). Assign the pointer cp to ptr[i] instead. Splitting a string on space can be done much more simpler in C++ than what you have though, see for example the following simple program: #include <iostream> #include <vector> #include <sstream> #include <algorithm> int main() { // Put a string into a string stream std::istringstr

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.