assets:precompile stack level too deep - ruby-on-rails-3

I'm trying to have success on running the task rake assets:precompile but I have the following error
** Invoke assets:precompile (first_time)
** Execute assets:precompile
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 tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
stack level too deep
(in .../app/assets/stylesheets/admin/scaffolds.css.scss)
.....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/Users/diogui/.rvm/rubies/ruby-1.9.2-p320/...]
.....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
.....rvm/gems/ruby-1.9.2-p320#global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
.....rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.1.1/lib/sprockets/assets.rake:9:in `ruby_rake_task'
....rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.1.1/lib/sprockets/assets.rake:17:in ` invoke_or_reboot_rake_task'
In my production.rb I have
config.serve_static_assets = false
config.assets.enabled = true
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
Yes I have Sass 3.1.4
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
Does anybody have an idea what is the problem ? Or what am I missing ? Thanks :)

It turns out this is a documented issue with the sass-rails gem: https://github.com/rails/sass-rails/issues/78
It can apparently be solved by downgrading the sass-rails gem to 3.1.4 (if you're on Rails 3.1) or upgrading to 3.2.5 (if you're on Rails 3.2): "rake aborted! stack level too deep" while deploying to Heroku
This worked for me :)

Changing the ruby version to 2.3.0 did the trick.
This one saved my day.

Related

cap stopped working missing bin file

capistrano was working fine, I don't know what I changed, but now I get this:
(cap3, rails4, using capistrano-rvm)
$ cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env
** Invoke rvm:hook (first_time)
** Execute rvm:hook
** Invoke rvm:check (first_time)
** Execute rvm:check
DEBUG [954551b1] Running ~/.rvm/bin/rvm version as myuser#myip
DEBUG [954551b1] Command: ~/.rvm/bin/rvm version
DEBUG [954551b1] bash: /opt/myuser/.rvm/bin/rvm: No such file or directory
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as myuser#myip: rvm exit status: 127
rvm stdout: Nothing written
rvm stderr: bash: /opt/myuser/.rvm/bin/rvm: No such file or directory
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: rvm exit status: 127
rvm stdout: Nothing written
rvm stderr: bash: /opt/myuser/.rvm/bin/rvm: No such file or directory
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:77:in `capture'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in `block (3 levels) in <top (required)>'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/joelnylund/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => rvm:check
At some point I did install a new ruby, but that seemed to work fine, rvm works fine on the server:
$ which rvm
/usr/local/rvm/bin/rvm
and:
$ rvm list
rvm rubies
=* ruby-2.0.0-p643 [ x86_64 ]
ruby-2.1.2 [ x86_64 ]
I have tried adding to deploy.rb :
set :rvm_type, 'system' set :rvm_bin_path, '/usr/local/rvm/bin/'
Any ideas?

rake assets precompile aborted with rails 3.2.11

I have to run rake assets:precompile command before deploying in rackspace server, recently upgraded rails version from 3.2.9 to 3.2.11 due to the security patch and Upgraded JSON GEM.
I get the following error and rake abort.
$> rake assets:precompile --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/rvm/rubies/ruby-1.9.3-p385/bin/...]
/usr/local/rvm/gems/ruby-1.9.3-p385#global/gems/rake-10.0.3/lib/rake /file_utils.rb:53:in `block in create_shell_runner'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in `sh'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.11/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.11/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/actionpack-3.2.11/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p385#global/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => assets:precompile
Any solution for this ?
May be memory issue?
Try upgrading the RAM in VPS

RoR: why doesn't rake db:migrate output anything?

I added add_column :microposts, :type, :string to one of my db migrations (not the most recent one if that matters). and also ran rake db:reset. So I have definitely made changes. But now if I run rake db:migrate or bundle exec rake db:migrate, it doesn't output anything. If I run trace...
alex#alex-ThinkPad-T410:~/rails_projects/final2$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
You wrote:
I added add_column :microposts, :type, :string to one of my db
migrations (not the most recent one if that matters).
This suspiciously sounds, as if you just added the text into the migration file. That won't work. The migration state machine doesnt notice changes in the actual text files. Please check
rake db:migrate:status
You should instead create a new migration
rails g migration AddTypeToMicropost type:string
and then run rake again

Migration silent error

When I run rake db:migrate, I don't get a response.
Doing a trace, I get the following but I am not sure how to interpret it:
$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
I am running rails 3.0.10.
As coreyword suggested, perhaps there are no new migrations to run.
The rake db:migrate command will exit silently when there's nothing (new) to do.

Resque hates kaminari dsl method paginates_per

So I'm converting my Admin mailers to use Resque and execute in the background.
When I ran:
rake resque:work QUEUE='*' --trace
I get this:
$ rake resque:work QUEUE='*' --trace (in /my/directory)
** Invoke resque:work (first_time)
** Invoke resque:preload (first_time)
** Execute resque:preload rake aborted! undefined method `paginates_per' for #<Class:0x000000045ba1b8>
which traces back to my Micropost model that default to 10 micropost per page using kaminari's dsl method paginates_per:
class Micropost < ActiveRecord::Base
.
.
.
paginates_per 10
How do I get rake to stop puking without moving the DSL method?