I am having the same issue mentioned here: Rake "already initialized constant WFKV_" warning
I changed my Gemfile to:
gem 'rack', '1.3.3'
If I run:rake cucumber:ok --trace
it looks like it runs:
/Users/jt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec cucumber --profile default
with the following errors:
rake aborted!
Command failed with status (1): [/Users/jt/.rvm/rubies/ruby-1.9.2-p290/bin/...]
/Users/jt/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/jt/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call'
/Users/jt/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh'
/Users/jt/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh'
If I run:
Sat Oct 08$ bundle exec cucumber
things seem to run ok.
How do I fix my gems so that rake cucumber:ok works ok?
thx
edit #1
Is there any way I could confirm which version of Rack that Cucumber is using? Or ensure that Rack 1.3.3 is ALWAYS being used.
You may try creating a temporary gemset and install bundle over there and try it out, following are the step to follow,
rvm gemset create temp_gemset
rvm gemset use temp_gemset
bundle install
Here temp_gemset is the name given to gemset
Have you tried running the rake task via bundle exec?
bundle exec rake cucumber:ok
Related
I'm following along to the excellent Michael Hartl Rails book (Rails 3.2) but am getting an error when attempting to run the command:
rake assets:precompile
The error is as follows:
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/rake assets:precompile assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or directory -- ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/rake assets:precompile (LoadError)
rake aborted!
Command failed with status (1): [/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/b...]
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack- 3.2.14/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/ruby_executable_hooks:14:in `eval'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/ruby_executable_hooks:14:in `<main>'
Tasks: TOP => assets:precompile
Thanks for your help!
I fixed this by reverting back from p448 to p392 and then running:
rvm ruby-1.9.3-p392#global do gem install executable-hooks
as suggested by mpapis here: Rake assets:precompile cannot find ruby
I was trying to run the rake command within ubuntu and was getting ruby_executable_hooks error. I resolved it with:
rvm all do gem install executable-hooks
This seems to be an issue with 1.9.3-p448. Today I updated ruby from p392 to p448 on my server and started getting this error. I reverted back to p392 and precompilation of assets is working again.
Perhaps try installing a version before p448 and try again.
After working with this a bit more, I found that emptying and reinstalling my gems caused precompilation to start working again:
$ rvm gemset empty
$ bundle install
$ rake assets:precompile RAILS_ENV=production
Platform: windows 7, running on JRuby 1.6.8.
C:\project> rake db:migrate
rake aborted!
You have already activated rake 10.0.3, but your Gemfile requires rake 0.9.2.2.
Using bundle exec may solve this.
OK. I have added
gem "rake", "= 0.9.2.2"
to Gemfile and ran:
C:\project> bundle exec rake db:migrate
bundler: command not found: rake
Install missing gem executables with `bundle install`
<polite>WTF?</polite>
I have also done
bundle install --deployment
to no avail.
I have different versions of rake installed:
C:\project>gem list
LOCAL GEMS
...
rake (10.0.3, 0.9.2.2, 0.8.7)
How to resolve this? I need rake db:migrate working with my specific (inherited) RoR project with gems that tend to be slightly out of date, but they are all specified in Gemfile.
Don't run bundle --deployment until you clearly understand what it is used for. (it's confusing, we usually use bundle install --path vendor/bundle)
The first error means, that you should execute your command with bundle exec, like bundle exec rake db:migrate
after the version change in the Gemfile you should have just run bundle install without --deployment.
At this point I'd recommend to delete the .bundle folder in your project home, this reverses the --deployment call. Afterwards call bundle install and try it again. If it doesn't work please let us know.
Don't get frustrated, bundle is pretty cool as soon as you get the hang of it.
I recently installed Rails 3.1 and now my old Rails 3.0 app won't rake db:migrate. This is what happens when I try to run bundle exec rake db:migrate. I'm on Ubuntu with no RVM
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:142:in `block in cripple_rubygems': can't find executable rake (Gem::Exception)
from /usr/local/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
When I run just rake db:migrate, it outputs:
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
(See full trace by running task with --trace)
which rake
/usr/local/bin/rake
Put this in your Gemfile:
gem 'rake' , '>= 0.9.2'
and run bundle update
you need to give more details in what environment you're running this:
which OS?
are you using RVM?
is this a brand new RVM setup per chance?
1) Try to run this:
gem list | rake
what output do you get?
2) If you don't see rake in the output, then do this:
gem install rake
and then try rake db:migrate again
3) If you see rake, but it still doesn't work, then do this:
which rake
what output do you get? it should look something like this:
~/.rvm/gems/ruby-1.9.2-p0/bin/rake
I have been trying to run rake but it seems that ever since I updated ruby gems rake is failing.
This morning I ran:
gem update --system
And ever since, rake has been failing with the following error:
$ rake db:migrate
rake aborted!
undefined method `specifications' for "/usr/lib/ruby/gems/1.9.1":String
/home/cknadler/projects/ecommerce/Rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)
I have been reading about this problem and it seems that there is a problem with rake 0.9.x that breaks rails but when I check my rake version, I am running 0.8.7:
$ rake --version
rake, version 0.8.7
I have tried uninstalling rake and reinstalling it, using bundler, etc and at this point I am pretty stuck. Thanks in advance.
Edit:
My Rakefile (located in my app root directory)
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
Ecommerce::Application.load_tasks
I would suggest using the bundled binary version of rake to avoid this issue.
bundle exec rake db:migrate
If you installed your bundle using binstubs (bundle install --binstubs) then you can also use the bin version of rake which is equivalent to the bundle exec rake command:
bin/rake db:migrate
P.S: I would also recommend using RVM instead of installing Ruby using sudo for all users. This allows you to keep more modular ruby and gem installation.
You should remove rake 0.9.x (you may have 0.9.2 installed) by doing
gem uninstall rake -v=0.9.2
And then run bundle update
bundle update
Hope that helps.
I'm running rails on Mac OS X. I think I installed it correctly, but I'm getting the following error.
$ rake db:create
(in /Users/user_name/myapp)
rake aborted!
Could not find RubyGem mocha (>= 0)
(See full trace by running task with --trace)
What is the problem? How do I fix it?
Looks like you're missing the mocha gem. Running sudo gem install mocha should fix the problem.
You can also use:
sudo rake gems:install
So it will go through your environment.rb to see which gems are depended upon and install them.