I get this error when i try to run "rake test":
avery#ubuntu:~/rails_projects/depot$ rake test
rake aborted!
You have already activated rake 10.0.1, but your Gemfile requires rake 10.0.0. Using bundle exec may solve this.
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:31:in `block in setup'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:17:in `setup'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler.rb:116:in `setup'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/setup.rb:7:in `<top (required)>'
/home/avery/rails_projects/depot/config/boot.rb:6:in `<top (required)>'
/home/avery/rails_projects/depot/config/application.rb:1:in `<top (required)>'
/home/avery/rails_projects/depot/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
when i try running "bundle exec rake" i get:
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/home/avery/rails_projects/depot/config/application.rb:7:in `<top (required)>'
/home/avery/rails_projects/depot/Rakefile:5:in `require'
/home/avery/rails_projects/depot/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
how can i fix this?
You probably have rake 10.0.0 in your Gemfile.lock.
Removing Gemfile.lock might solve the problem.
For the first part of the question: I ran into the same problem and solved it with a:
gem regenerate_binstubs
after that
gem -V
reveals 10.0.0 again.
Answer of 1st query
In your Gemfile, explicitly set the latest rake version by
gem 'rake', '~> 10.0.1'
And then run
$ bundle update rake
Answer of 2nd query
put this in your Gemfile and run bundle install
gem 'therubyracer'
For the second part of the question, you just need to add this to your Gemfile:
gem 'therubyracer'
If you've specified a rake version in your Gemfile that your project requires, eg:
gem 'rake', '~> 10.0.0'
Try installing it again
bundle install
Related
i cloned the sample app from https://bitbucket.org/railstutorial/sample_app_4th_ed and followed the instruction there, but rails db:migrate is aborting
C:\Sites\sample_app>rails db:migrate
rails aborted!
LoadError: cannot load such file -- bcrypt_ext
C:/Sites/sample_app/config/application.rb:7:in `<top (required)>'
C:/Sites/sample_app/Rakefile:4:in `require_relative'
C:/Sites/sample_app/Rakefile:4:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
Caused by:
LoadError: cannot load such file -- 2.3/bcrypt_ext
C:/Sites/sample_app/config/application.rb:7:in `<top (required)>'
C:/Sites/sample_app/Rakefile:4:in `require_relative'
C:/Sites/sample_app/Rakefile:4:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
(See full trace by running task with --trace)
Try to uninstall bcrypt completely with:
gem uninstall bcrypt-ruby
gem uninstall bcrypt
Be sure all versions are uninstalled, then run
gem install bcrypt --platform=ruby
Try to run bundle install. After this worked you could try to run rake db:migrate again.
When I am running rake db:create in my ruby on rails project it's giving me error LoadError: incompatible library version - /home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma/puma_http11.so
Here is full error
tps#tps-H81M-S1:~/sites/my_app$ rake db:create
rake aborted!
LoadError: incompatible library version - /home/tps/.rvm/gems/ruby- 2.3.1/gems/puma-3.6.0/lib/puma/puma_http11.so
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma/server.rb:15:in `require'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma- 3.6.0/lib/puma/server.rb:15:in `<top (required)>'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma.rb:14:in `require'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma.rb:14:in `<top (required)>'
/home/tps/sites/my_app/config/application.rb:7:in `<top (required)>'
/home/tps/sites/my_app/Rakefile:4:in `<top (required)>'
/home/tps/.rvm/gems/ruby-2.3.1/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
Can anyone please help me?
Thanks in advance
Try this(version 3.6.0):
gem uninstall puma
and
bundle
or try this
gem pristine --all
or for specific gem
gem pristine puma
Please forgive my ignorance. I'm having issues raking my database on heroku. When I run :
heroku run rake db:migrate
I get
rake aborted!
LoadError: cannot load such file -- ffaker
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:247:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:247:in `block in require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:232:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:247:in `require'
/app/lib/tasks/seed.rake:1:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:241:in `load'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:241:in `block in load'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:232:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:241:in `load'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:654:in `bl
ock in run_tasks_blocks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:654:in `ea
ch'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:654:in `ru
n_tasks_blocks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/application.rb:384:i
n `run_tasks_blocks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:449:in `lo
ad_tasks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/railtie.rb:194:in `p
ublic_send'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/railtie.rb:194:in `m
ethod_missing'
/app/Rakefile:6:in `<top (required)>'
(See full trace by running task with --trace)
I've tried following the solutions from heroku rake db:migrate > no such file to load -- faker with no luck. I really am not sure where else to go from here. I would greatly appreciate any help. Thanks.
You should specify this in your code:
require 'ffaker'
Also, make sure you have ffaker in the right gem group. I was setting up a staging environment and wanted to load dummy data and forgot ffaker was only in development and testing environment groups.
I was using the git URL to add ffaker in my Gemfile. I removed this URL, run bundle again and everything works ok now.
- gem 'ffaker', '~>2.10.0', git: 'https://github.com/ffaker/ffaker.git'
+ gem 'ffaker', '~>2.10.0'
I've been working on a Ruby on Rails project for class and have run into some problems. When I run bundle install, all of my gems install appropriately. When I run rake db:setup, I get the following error.
tuggernuts2#tn-Extensa5620:~/Workspace/Class/baseball-manager$ rake db:setup
rake aborted!
cannot load such file -- ./bundler/setup
/home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:6:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
I am also get this error when I try to run any of my unit tests:
tuggernuts2#tn-Extensa5620:~/Workspace/Class/baseball-manager$ ruby test/unit/user_test.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require': cannot load such file -- ./bundler/setup (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:6:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/tuggernuts2/Workspace/Class/baseball-manager/config/environment.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/tuggernuts2/Workspace/Class/baseball-manager/test/test_helper.rb:2:in `<top (required)>'
from test/unit/user_test.rb:2:in `require_relative'
from test/unit/user_test.rb:2:in `<main>'
I'm working on this project with a group of 4 others, and no one else is getting these errors so I infer that the problem is with my setup and not with the code.
I'm running ruby version "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]"
I'm running ruby gems version 1.8.23
I'm running rails version 3.2.5
but when I run rails -v I get the same require error, and the same ./bundler/setup error as above. I've been googling these problems for awhile and non of the solutions I've found so far have helped.
I've tried re-installing gems, I've tried running gem update -system, but that just gives me:
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.
The rake errors are new as of yesterday, the ruby require errors have been there pretty much since the beginning. Life has been a struggle.
I've tried a bunch of combinations of require, require "./...", require_relative, and nothing seems to fix the require errors.
Any and all help is appreciated. Thanks in advance.
Edit: Output from: bundle exec rake db:setup --trace
tuggernuts2#tn-Extensa5620:~/Workspace/Class/baseball-manager$ bundle exec rake db:setup --trace
rake aborted!
cannot load such file -- ./bundler/setup
/home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:7:in `require'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:7:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `require'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/Rakefile:5:in `require'
/home/tuggernuts2/Workspace/Class/baseball-manager/Rakefile:5:in `<top (required)>'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/var/lib/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
I am using Rails 3.2.9 with ruby 1.9.3 (made default using RVM). From the root directory of my test_app when I executed the command 'rails console' / 'rails c', the following error is showing.
rails console
/home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /home/local/rajesh.co/Rajesh/blog/config/application.rb:7:in `<top (required)>'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:39:in `require'
from /home/local/rajesh.co/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can anyone help me to resolve this?
Yes, I got the answer for my question.
Just Open the file 'Gemfile' inside the root directory of your application folder, and then paste the below lines there.
gem 'execjs'
gem 'libv8'
gem 'therubyracer'
After pasting it, just save the file and execute 'bundle update' on the command prompt.
On finishing bundle update successfully, you try running 'rails c' or 'rails console' for taking the rails console. It works!!
Thank you.
Install the folowing both:
gem 'execjs'
gem 'therubyracer'
Try installing
gem 'therubyracer'
Source