when executing the rake tasks, it issues this message:
warning: already initialized constant STATS_DIRECTORIES
¿how can I load it, using rails 4?.
thanks for you help.
Related
I am using ubuntu 18.4, Ruby 2.7.3 , rails 4.2.11.1, Rake 10.0.0
While trying to run the rake admin:create, I am getting the below error message. Can any one help me on this.
/home/ubuntu/.rbenv/versions/2.7.3/lib/ruby/2.7.0/uri/version.rb:3: warning: already initialized constant URI::VERSION_CODE
/home/ubuntu/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/uri-0.10.1/lib/uri/version.rb:3: warning: previous definition of VERSION_CODE was here
/home/ubuntu/.rbenv/versions/2.7.3/lib/ruby/2.7.0/uri/version.rb:4: warning: already initialized constant URI::VERSION
I'm having some problem when running any rake command in my rails application:
humberto#asterix:/var/www/avante-q-a$ rake db
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:11: warning: already initialized constant DEFAULT_HOOKS
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:23: warning: already initialized constant DEFAULT_PRINT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:48: warning: already initialized constant SIMPLE_PRINT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:57: warning: already initialized constant CLIPPED_PRINT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:62: warning: already initialized constant DEFAULT_EXCEPTION_HANDLER
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:68: warning: already initialized constant DEFAULT_EXCEPTION_WHITELIST
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:71: warning: already initialized constant DEFAULT_PROMPT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:82: warning: already initialized constant SIMPLE_PROMPT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:84: warning: already initialized constant SHELL_PROMPT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:91: warning: already initialized constant NAV_PROMPT
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:107: warning: already initialized constant DEFAULT_CONTROL_D_HANDLER
/home/humberto/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.9.6/lib/pry.rb:121: warning: already initialized constant DEFAULT_SYSTEM
rake aborted!
cannot load such file -- pry/nav
(See full trace by running task with --trace)
I've already run bundle install and it worked succesfull. Do someone know what is missing here? Thanks since now.
You should try re-running it within a bundler context:
bundle exec rake db
Bundle exec loads bundler first and hooks all of the gems into the current environment before rake is loaded.
whenever I run a rake task on the command line I get this error message:
'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Billings::Application#task called at /Library/Ruby/Gems/1.8/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks'
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_test_loader
Can anybody tell me how to get rid of this?
How about generating a new app in another directory an copy the Rakefile? If the problem persists, it may be a problem of your custom rake tasks or some of your gems/plugins.
Possible conflict with Rake extension maybe?
md:~/Dropbox_not_syncd/webs/3/tdd/rubyists$ rake db:drop
/home/durrantm/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/version.rb:4: warning: already initialized constant MAJOR
...
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/home/durrantm/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task_arguments.rb:73: warning: already initialized constant EMPTY_TASK_ARGS
..
rake aborted!
stack level too deep
(See full trace by running task with --trace)
An answer to my problems - at least they have gone away and I can move on - was to use
bundle exec rake spec
over
rake spec
Some time later....
eventually I was able to blow away my rcm or at least delete all rvm related files and then I could go back to use 'rake spec', etc. Though I did also create and repopulate the application too along with this.
I new to rails,
i've done all steps from this tutorial http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac on my ubuntu 11.04 but i'm unable to run rake db:migrate.
It gives to this output:
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/version.rb:4: warning: already initialized constant MAJOR
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/version.rb:5: warning: already initialized constant MINOR
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/version.rb:6: warning: already initialized constant BUILD
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/version.rb:3: warning: already initialized constant NUMBERS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/version.rb:9: warning: already initialized constant VERSION
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake.rb:26: warning: already initialized constant RAKEVERSION
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/early_time.rb:17: warning: already initialized constant EARLY
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/alt_system.rb:32: warning: already initialized constant WINDOWS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/application.rb:28: warning: already initialized constant DEFAULT_RAKEFILES
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/task_arguments.rb:73: warning: already initialized constant EMPTY_TASK_ARGS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/invocation_chain.rb:49: warning: already initialized constant EMPTY
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/dsl_definition.rb:143: warning: already initialized constant Commands
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:44: warning: already initialized constant ARRAY_METHODS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:47: warning: already initialized constant MUST_DEFINE
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:51: warning: already initialized constant MUST_NOT_DEFINE
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:55: warning: already initialized constant SPECIAL_RETURN
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:61: warning: already initialized constant DELEGATING_METHODS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:364: warning: already initialized constant DEFAULT_IGNORE_PATTERNS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_list.rb:370: warning: already initialized constant DEFAULT_IGNORE_PROCS
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake.rb:64: warning: already initialized constant FileList
/home/breedish/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake.rb:65: warning: already initialized constant RakeFileUtils
rake aborted!
stack level too deep
How can i fix rake to run my initial migration
I have 1.9.2 ruby, 3.0.10 rails
thx for any help
I ran into this error recently too. Resolved it by placing bundle exec in front of the command.
bundle exec rake db:migrate
Here's a previous StackOverflow question with the same error.
And, there's more information about bundle exec here.
Try to install an older version of rake.
gem install rake -v=0.8.7
You might get a warning message when using rake.
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
You can just add "include Rake::DSL" to the Rakefile before the applications load_tasks were called.
I found a post to fix that issue.
Global access to Rake DSL methods is deprecated