I am trying to precompile my assets:
rake assets:precompile RAILS_ENV=production bundle exec rake assets:precompile
and getting the following error:
Don't know how to build task 'bundle' (See the list of available tasks with "rake --tasks")
After --trace:
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke yarn:install (first_time)
** Execute yarn:install
yarn install v1.17.3
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.04s.
** Execute assets:precompile
rake aborted!
Don't know how to build task 'bundle' (See the list of available tasks with `rake --tasks`)
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task_manager.rb:59:in `[]'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:159:in `invoke_task'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/Users/anton/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/Users/anton/.rbenv/versions/2.6.3/bin/rake:22:in `load'
/Users/anton/.rbenv/versions/2.6.3/bin/rake:22:in `<main>'
How to fix this problem? I tried to update my gems, re-installed everything, added gem 'rake' and still getting the same error. Thank you very much for your help.
Rails version: ~> 5.1.6
You seem to have mixed up your commands so that you are attempting to call two commands as one.
It appears, you are actually trying to call only this:
RAILS_ENV=production bundle exec rake assets:precompile
With the command you have used originally, you are trying to call the rake tasks named assets:precompile, bundle, exec, rake and again assets:precompile. Since you don't have a rake task named bundle, you got the error you quoted.
Related
Rake is not working. The error states that there is a problem calling rake due to RVM.
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
I've screenshot the problem.
Look at the Rails project structure
--project_name
--app
--bin
--config
--db
--lib
--log
--public
--test
--tmp
--vendor
--config.ru
--Gemfile
--Gemfile.loc
>>--Rakefile
--READNE.md
When I run rake -t without project then it's showing the error like
:~/workspace $ rake -t
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:698:in `raw_load_rakefile'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:103:in `load_rakefile'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:82:in `block in run'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/lib/rake/application.rb:80:in `run'
/usr/local/rvm/gems/ruby-2.3.4/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.4/bin/rake:22:in `load'
/usr/local/rvm/gems/ruby-2.3.4/bin/rake:22:in `<main>'
/usr/local/rvm/gems/ruby-2.3.4/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.4/bin/ruby_executable_hooks:15:in `<main>'
but when I run rake -t inside Rails project then it's working like
:~/workspace/recipies (master) $ rake -t
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
** Execute default
Run options: --seed 14039
# Running:
..E
That means on your hand the Rakefile not found anywhere. SO you need to run this inside project where Rakefile exists.
Note: You can use rake -t or rails -t. Since Rails 5.0+ has rake commands built into the rails executable, bin/rails is the new default for running commands.
I have created a small project with rails and added the requirejs-rails gem. I have set it up as required and while running assets:precompile, it fails when requirejs-rails tries to compile the javascript resources. However, oddly enough, the assets:precompile seems to work when in debug mode. Unfortunately, I need it to run in non-debug mode so it can be properly deployed on Heroku. Below is the error and stack trace. Any one encountered this? More importantly, any solution to this?
/home/whyves/.rvm/rubies/ruby-2.1.2/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/whyves/RubymineProjects/test2/bin/spring rake --trace assets:precompile
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke requirejs:precompile:external (first_time)
** Invoke requirejs:test_node (first_time)
** Execute requirejs:test_node
** Execute requirejs:precompile:external
/home/whyves/.rvm/rubies/ruby-2.1.2/bin/ruby rake --trace assets:precompile requirejs:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
/home/whyves/.rvm/rubies/ruby-2.1.2/bin/ruby: No such file or directory -- rake --trace assets:precompile (LoadError)
rake aborted!
Command failed with status (1): [/home/whyves/.rvm/rubies/ruby-2.1.2/bin/ru...]
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:54:inblock in create_shell_runner'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in call'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:45:insh'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in sh'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils.rb:82:inruby'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in ruby'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/requirejs-rails-0.9.3/lib/tasks/requirejs-rails_tasks.rake:19:inruby_rake_task'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/requirejs-rails-0.9.3/lib/tasks/requirejs-rails_tasks.rake:86:in block (3 levels) in <top (required)>'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:incall'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:in block in execute'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:ineach'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:in execute'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain'
/home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:172:ininvoke_with_call_chain'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:201:in block in invoke_prerequisites'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:199:ineach'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:199:in invoke_prerequisites'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:178:inblock in invoke_with_call_chain'
/home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:172:ininvoke_with_call_chain'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:165:in invoke'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:150:ininvoke_task'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in block (2 levels) in top_level'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:ineach'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in block in top_level'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:115:inrun_with_threads'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:100:in top_level'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:78:inblock in run'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:176:in standard_exception_handling'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:75:inrun'
/home/whyves/RubymineProjects/test2/bin/rake:8:in <top (required)>'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:inload'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in block in load'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:inload_dependency'
/home/whyves/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in load'
/home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
/home/whyves/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require'
-e:1:in'
Tasks: TOP => assets:precompile => requirejs:precompile:external
Process finished with exit code 1
`
I have found the problem, it is not with rails or requirejs-rails. The problem lies with my IDE (RubyMine). When I precompile from a command window, it works but when I launch the task from RubyMine, it fails!
I am having similiar problems like a lot of users when compiling assets on their productive box. The only difference is that I can't get any hint out of the trace to solve the problem.
rake assets:precompile RAILS_ENV=production --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/rbenv/versions/1.9.3-p362/bin/ruby /usr/local/rbenv/versions/1.9.3-p362/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
Command failed with status (): [/usr/local/rbenv/versions/1.9.3-p362/bin/r...]
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:53:in `block in create_shell_runner'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:45:in `call'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:45:in `sh'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `sh'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:80:in `ruby'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `ruby'
/home/app/application/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/app/application/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/app/application/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:205:in `call'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:200:in `each'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:94:in `each'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/usr/local/rbenv/versions/1.9.3-p362/bin/rake:32:in `<main>'
Tasks: TOP => assets:precompile
There is effectively no status code, just the fail. It also does not make any difference if I call rake directly or via bundle exec.
About the environment
debian squeeze box with a global rbenv installation (/usr/local/rbenv like you can see from the trace). Ruby 1.9.3 2012-12-25 patchlevel 362.
Any hints / ideas on this?
I am going to answer this myself because I could solve it more or less. If someone has additions, don't hesitate to write an own answer or comment this answer/question.
What I've found out so far:
If you play around with assets:precompile by e.g just compiling the primary assets (assets:precompile:primary) or explicitly calling assets:precompile:all you might end up with a hint about the source of your problem. In my case, I ran into Errno::EACCES on both public/ and tmp/. Somehow that was not displayed, so make sure your user has full rights to create/delete files and folders there.
In my case, it worked sometimes because I've shut down the rails app and precompiled while it was down. Since precompiling allocates a lot of memory, I did some trial and error and eventually got the known Killed message when rake tries to execute asstes:precompile:primary. The task simply was killed because of using too much memory.
Another problem was that sprockets could not find bootstrap to put it into the assets pipeline on precompilation. Moving gem 'bootstrap' outside of group :assets solved this. This was also something I got hinted to when I played around with the commands.
The best way to solve – or better: work around – this problem is to simply compile your assets locally. Just throw a rake assets:precompile RAILS_ENV=development into your terminal and then deploy public/assets. Remember to delete that folder in your development environment after deploying it or you will end up debugging on why your changes on app/assets/* are not taking effect in development. At least that works for me(tm).
Alternatively, growing your swap partition may also work. However, compilation on a VPS where you need to use swap may take its while, so I'd stick to the local way.
I also had same issue.
I fixed it by adding swap(in my case 1gb for 512RAM available on my server)
Try running htop while your assets are compiling to see if you run out of RAM. Adding swap fixed it for me.
See this guide for adding swap: https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
at the moment I want to upgrade redmine 1.4.0 to the latest version 2.0.2.
So I followed the howto on this page:
http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
In short I downloaded the redmine-source and extracted it in a separate folder
"/var/www/redmine-2.0.2"
(whereas my working installation is in /var/www/redmine).
up to Step 3.5 everything went fine but in 3.6
the following happens:
root(at)information:/var/www/redmine-2.0.2# rake config/initializers/session_store.rb
rake aborted!
Don't know how to build task 'config/initializers/session_store.rb'
(See full trace by running task with --trace)
root(at)information:/var/www/redmine-2.0.2# rake --trace
config/initializers/session_store.rb
rake aborted!
Don't know how to build task 'config/initializers/session_store.rb'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/task_manager.rb:49:in `[]'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:115:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake -
0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-
0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/bin/rake:33:in `<top
(required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
root(at)information:/var/www/redmine-2.0.2#
root(at)information:/var/www/redmine-2.0.2# rake --trace generate_session_store
Invoke generate_session_store (first_time)
Invoke generate_secret_token (first_time)
Invoke config/initializers/secret_token.rb (first_time)
Execute config/initializers/secret_token.rb
Execute generate_secret_token
Execute generate_session_store
Note: The rake task generate_session_store has been deprecated, please use the
replacement version generate_secret_token
root(at)information:/var/www/redmine-2.0.2#
root(at)information:/var/www/redmine-2.0.2# rake generate_session_store
Note: The rake task generate_session_store has been deprecated, please use the
replacement version generate_secret_token
root(at)information:/var/www/redmine-2.0.2# rake --trace generate_secret_token
Invoke generate_secret_token (first_time)
Invoke config/initializers/secret_token.rb (first_time, not_needed)
Execute generate_secret_token
this last step seems to generate "/var/www/redmine-2.0.2/config/initializers/secret_token.rb"
and according to the how to it is a sufficient substitute to the "rake-commands" before.
root(at)information:/var/www/redmine-2.0.2#
root(at)information:/var/www/redmine-2.0.2# rake db:migrate RAILS_ENV=production
root(at)information:/var/www/redmine-2.0.2# rake tmp:cache:clear
root(at)information:/var/www/redmine-2.0.2# rake tmp:sessions:clear
My first prob is how to start the application. I can still go to my old installation "/var/www/redmine"
and start with
ruby ./script/server -e production &
which still works, the output is:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-
2.3.14/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated
in the future, use String#encode instead.
=> Booting Mongrel
=> Rails 2.3.14 application starting on http://0.0.0.0:3000
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after
2011-11-01.
Gem.source_index called from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-
2.3.14/lib/rails/gem_dependency.rb:21.
=> Call with -d to detach
=> Ctrl-C to shutdown server
But I can't start the application by going to the new folder "/var/www/redmine-2.0.2/"
and calling
ruby ./script/server -e production &
because there is no file
"/var/www/redmine-2.0.2/script/server".
How can I start the updated version of redmine or is not possible yet ?
I think redmine 2.0.2 needs rails 3.2.5 and I thought I installed
it because:
root(at)information:/var/www/redmine-2.0.2/script# rails -v
Rails 3.2.5
root(at)information:/var/www/redmine-2.0.2/script#
According to the boot protocol above Rails 2.3.14 is used. Wrong ?
Whats my mistake here ? Can somebody give advice howto
succesfully upgrade ?
thanks for your help in advance!
Cheers,
Ansgar
Solve it by using bundle exec rails s -d -e production to start the application in background using the default port (i.e. 3000).
Update
It seems to be an RVM issue, if you open a new shell and running:
$ type rvm | head -1
does not show "rvm is a function", RVM isn't being sourced correctly.
Ensure that RVM is sourced after any path settings as RVM and manipulates the path. If you don't do this, RVM may not work as expected.
I'm finding that Thinking Sphinx sometimes errors out when I try to run its Rake tasks. Sometimes the tasks work fine, and sometimes I get errors like the one below.
I'm running the tasks as a normal user, not root. Not using sudo.
In the example below, searchd is still running after the Rake task fails.
I've also seen similar errors with ts:rebuild.
Has anyone else seen this?
I'm using Sphinx 0.9.9-release (r2117)
I'm using Thinking Sphinx 1.4.4 instead of the latest version because I'm on Rails 2.3.11.
$ rake ts:stop RAILS_ENV=production
(in /var/www/blog_app/releases/20110425053509)
rake aborted!
execution expired
(See full trace by running task with --trace)
[ethan#apphost current]$ rake ts:stop RAILS_ENV=production --trace
(in /var/www/blog_app/releases/20110425053509)
** Invoke ts:stop (first_time)
** Invoke thinking_sphinx:stop (first_time)
** Invoke thinking_sphinx:app_env (first_time)
** Execute thinking_sphinx:app_env
** Invoke environment (first_time)
** Execute environment
** Execute thinking_sphinx:stop
rake aborted!
execution expired
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/timeout.rb:60
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/thinking-sphinx-1.4.4/lib/thinking_sphinx/tasks.rb:58
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/opt/ruby/bin/rake:19:in `load'
/opt/ruby/bin/rake:19
I believe this error is caused when you have a search daemon already running.
Try
ps | grep searchd
if that gives you something like this...
73470 ttys002 0:00.03 searchd --pidfile --config /Users/dwickwire/Projects/production/config/development.sphinx.conf
81907 ttys002 0:00.00 grep searchd
then kill the searchd
sudo kill -9 process_id
process_id in my case would be 73470
Then try rake ts:rebuild again.
I tried command 'ps | grep searchd' to get process ID, but I didn't get it.
Then I tried command 'pgrep searchd', it gives me process ID.
I killed that process and ran command 'rake ts:rebuild'. It worked.
I blogged about the entire experience here (disclaimer: I'm the author).
In thinking_sphinx 1.4.4 there is a 5 second timeout on rake ts:stop
If rake ts:stop takes close to or longer than 5 seconds, ruby will throw an exception.
I'm using the thinking_sphinx 1.3.18 in the meantime. (there is no timeout on 1.3.18).
Also I have submitted a patch to the github repository and the timeout will be configurable with a sphinx.yml configuration variable stop_timeout.
NOTE: rake ts:rebuild == rake ts:stop; rake ts:index; rake ts:start
I guess after deploy by capistrano you didn't run rake thinking_sphinx:configure
it would generate sphinx config file in config/production.sphinx.conf
try add pidfile to config/sphinx.yml
production:
...
pid_file: "/tmp/searchd.pid"
it will make sure to find pid of searchd to kill
and added following code to config/deploy.rb
namespace :my_tasks do
task :generate_sphinx_config, :roles => [:web] do
run "cd #{latest_release} && RAILS_ENV=#{rails_env} bundle exec rake thinking_sphinx:configure"
end
end
....
after :deploy, "my_tasks:generate_sphinx_config"
to generate sphinx config file in each release folder
The Problem
This problem occurs if your searchd crashed or you killed it manually. On Windows it doesn't overwrite your searchd.<environment>.pid, so still the old PID is saved and ThinkingSphinx doesn't check the real running processes in your taskmanager. So all these commands (rake ts:restart, rake ts:rebuild, ...) won't work, rake will always abort and you get the error rake aborted, ... searchd already running
The solution
Delete your path-to/your-app/log/searchd.<environment>.pid.
<environment> may be development or production, depending on your current stage.
Hope this answer will help the googler's.