Path's issue with bundler, to change or not to change?
I'm trying to setup a new rails 3 project with bundler, but i ran into issues with bundler. I'm on rails 3.0.3 with ruby 1.8.7
When trying to do
$ bundle exec rake db:migrate
I get the following error
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/dependency.rb:52:in `initialize': Valid types are [:development, :runtime], not nil (ArgumentError)
Same goes for when I try to issue a regular rake task in my terminal, one like
$ rake -T
i.e., only then I get the error:
uninitialized constant Bundler /Users/daniel/cc/contributie_data/Rakefile:4 (See full trace by running task with --trace)
I've been reading some other questi开发者_运维问答ons regarding this problem, therefore i've learned it has something to do with paths...
$ which rake
/usr/bin/rake
$ which ruby
/usr/local/bin/ruby
Can anyone give me some suggestions about what could be happening here? And even more important, how I can get bundler to play nice with rake..
Thanks for any input on this, much appreciated!
I got the same error (I'm using rvm). It turned out that in both my .profile and .bashrc was the following statement:
export PATH=~/.gem/ruby/1.8/bin:$PATH
So this path was taken instead of the rvm path. I commented these lines out and now everything works fine
Try to delete Gemfile.lock. It usually helps with
Valid types are [:development, :runtime], not nil
error.
Oh man, I just when through this today.
I did an update, and my rvm broke -- started throwing up on missing scripts and the like. I just got finished completely reinstalling rvm and my rubies.
it's not great, and it takes a while but it's what I did to get back to a working state.
Started here. How can I remove RVM (Ruby Version Manager) from my system? Ended up going through and installing fresh.
I too face the same issue and resolved it with the help of this link github:bundler
Modified a line in the file lib/bundler/resolver.rb
which is reside inside bundler gem
. Remove *
mark from the line d = Gem::Dependency.new(base.first.name, *reqs)
like this:
reqs = [dep.requirement.as_list, base.first.version.to_s].flatten.compact
d = Gem::Dependency.new(base.first.name, *reqs)
to
reqs = [dep.requirement.as_list, base.first.version.to_s].flatten.compact
d = Gem::Dependency.new(base.first.name, reqs)
*modifying content of a gem directly is not a good practice. Posted this just to show another way to resolve this issue.
精彩评论