Soo the problem occured after i got rspec installed when i do rails g controller name i get the following error:
/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
require': cannot load such file -- bundler/setup (LoadError) from
/home/ev0lution/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
require' from /home/ev0lution/RailsP/ticketee/config/boot.rb:3:in
<top (required)>' from bin/rails:7:inrequire_relative' from
bin/rails:7:in `'
i havent even done anything with it yet only created 1 single test file and i need a controller for it.
Try run bundle install in your application. seems like some gem is missing. And if command still give similar error try run command with bundle exec.
Related
I'm receiving this error when trying to run any rails or rake command.
/Library/Ruby/Gems/2.0.0/gems/xray-rails-0.1.17/lib/xray-rails.rb:5:in `require_relative': cannot load such file -- /Library/Ruby/Gems/2.0.0/gems/xray-rails-0.1.17/lib/xray/middleware (LoadError)
from /Library/Ruby/Gems/2.0.0/gems/xray-rails-0.1.17/lib/xray-rails.rb:5:in `<top (required)>'
Looks like not only experienced this. Here is same issue.
I suggest you to downgrade xray-rails to 0.1.16 or try to figure out by yourself whats going on and why middleware not loaded.
I am unable to any rake tasks within my Rails project. Any attempt to do so results in the following error, stating that it cannot locate an rspec file for ci_reporter:
rake aborted!
LoadError: cannot load such file -- ci/reporter/rake/rspec
/Users/blake/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Users/blake/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
/Users/blake/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/blake/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
/Users/blake/workspaces/ruby/minestatus/Rakefile:6:in `<top (required)>'
/Users/blake/.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in `eval'
I have made the following attempts to reset my environment to a working state:
Installing the newest ci_reporter gem from github
Deleting Gemfile.lock and re-running bundle install
Reinstalling Ruby 2.0.0 using rvm
Unfortunately none of the above things have helped me solve this issue. I am able to run rake tasks in other Rails projects, but not in this one. Rake tasks used to run just fine, and I'm not sure what changes I could've made to break things. Does anyone have an idea of what I can do to get rake tasks to run properly again?
I've just installed a fresh Ruby on Rails dev stack on my new Macbook, which runs Mac OS X 10.9 Mavericks.
Here is my stack:
Xcode command line tools
Homebrew
Rbenv
Bundler
Ruby 2.1.0
Rails 4.1.1
I ran rails new test_app to generate a first test app.
This command successfully completed, but since it, every Rails command I try in my CLI returns this kind of error message:
$ test_app > bin/rails server
/Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load': no implicit conversion of nil into String (TypeError)
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/me/Documents/[PERSONNEL]/dev/test_app/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Same error while trying to start a console:
$ test_app > bin/rails c
/Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load': no implicit conversion of nil into String (TypeError)
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/me/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
The bin/rake are working partially (I can use bin/rake routes but migrations are not working).
My last try was to install XCode, but it didn't solve it.
UPDATE: the command bundle exec rake rails:update:bin as mentioned bellow solve the problem for project, but needed to be executed on every new problem.
The problem seems to be deeper.
OK I found solution.
I've cleaned my mac too. and I got same error.
rails_root/bin folder is not there?
Try below
bundle exec rake rails:update:bin
I have the same problem. Short exploration follows below.
First of all, I have [] in the root path for my application. The error during rails s command
psylone#wizard:~/ruby-rails[code]/context$ rails s
/home/psylone/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:30:in `load': no implicit conversion of nil into String (TypeError)
is in spring gem here: https://github.com/rails/spring/blob/master/lib/spring/client/rails.rb#L27
That's because if Dir.glob contains [] in the path argument the result will be an empty array. So it's necessary to escape [] in the path argument for Dir.glob method. I think about something like this:
# Instead of line 27 in spring/client/rails.rb
require 'shellwords'
path = Shellwords.escape(Spring.application_root_path) << "/{bin,script}/rails"
load path
After this fix I've found rails s command works fine. But rails c command still causes an error. Probably the answer has the same nature.
So, the simplest way to avoid this error - rename the root path for your application (without [] characters).
I am a ruby novice.I created my first ruby on rails application which named "HelloRubyWeb" on my mac.Then "cd HelloRuby",But when I input the command "rails s" ,it returned the error log:
/Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:74:in `require': no such file to load -- coffee/rails (LoadError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:74:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /Users/admin/Ruby/HelloRuby/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:53:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:53
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.7/lib/rails/commands.rb:50
from script/rails:6:in `require'
from script/rails:6
Can any one help me? Very thanks.
kasperite is probably right, in the terminal run:
bundle then run rails s
Post the errors you get if any.
I had the same issue, but in my case it was because of the explicit coffee-rails version.
1) remove strictly set version for coffee-rails gem in Gemfile
2) run bin/bundle
3) run bin/bundle update
4) run bin/rails s
If you need explicitly set working version, just run bin/bundle show 'coffee-rails' and copy the version number from the terminal.
When I try to run "rake test" on my newly generated rails application I receive the following error
Computer:heroku user$ rake test:units
/Users/user
file doesnt exist
/Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': cannot load such file -- /Users/user/test/unit/helpers/things_helper_test.rb (LoadError)
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `each'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [/Users/user/.rvm/rubies/ruby-1.9.3-p0/b...]
Tasks: TOP => test:units
(See full trace by running task with --trace)
I am guessing that this is related to my setup somehow, as it seems as if rake is looking for the generated files in my home directory instead of the rails application directory. Could you help direct me to what I am doing wrong?
I am using Mac OS X Lion, have two installed ruby versions (1.8.7 come with lion, 1.9.3 which I am using for the application has been installed using rvm).
The application works if I run "rails s".
Update: If I create a new rails application from scratch, adding only a generated scaffold, the rake test command works. Ergo, it might be a incompatibility issue as the failing rails application was created on another computer, uploaded to heroku and then cloned from there to a new computer.
Funny story. I'd accidentally put some test code in one of the files, among other containing:
Dir.chdir("../..")
I'm guessing that when I run rake test the file got executed to load the class contained in the file, and caused problems when looking for the next file, when the current directory had suddenly changed.