Search code examples
rubyrubygemsrubymine

Ruby problem(bug)- in rake gem


i am running ruby 1.9.2p0 on rails on windows OS with rubymine 3.1.1.

i use it for גseveral weeks.

a few days ago- i tried to run my project from rubymine and the console notification was: "Could not find rake-0.8.7 in any of the sources

Process finished with exit code 7"

i googled it and i found reference to this problem in several places. the solution repeated most often was to delete the non-versioned "rake.gemspec" file. i tried this solution but the problem is not resolved, it still says the same notification.

i trying to solve this problem for several days!!! please help me if you know how!!!

thanks a lot in advanced!


Solution

  • Asaf, I've had literally hours of frustration dealing with similar problems. The solution can be a challenge to track down, because there are numerous reasons you could be having the problem. I'm no expert myself, but I'll try to pass on some of what I've learned.

    First, you mentioned getting an error about Rake, but didn't mention that you had tried to actually run Rake. Are you getting the error upon loading up RubyMine or specifically after running a Rake command?

    Next, if you are running a Rake command and getting an error, you should take note that WHERE you run the command from is pretty important. For example, if you keep a Terminal window open like I do, and run the Rake command from Terminal, you won't necessarily get the same results you would get by running Rake from RubyMine itself. The reason for this was not self-evident when I first started with RubyMine, but I think it comes down to this:

    The Ruby SDK and Gems preferences in RubyMine should be determining what types of dependency errors you get from within RubyMine. So you might start by looking there to see if there are any dependency errors. Next, I would guess that you're running RVM? Please be aware that it is completely possible to be using one RVM set in RubyMine (check the Ruby Interpreter in SDK and Gems Preferences to see which one you're using) and an entirely different RVM in Terminal (the command "RVM info" should get you the version you're using). If those don't match, you could very well get different results from both RubyMine and Terminal, even when running exactly the same commands.

    My solution to this problem was to carefully ensure that both of my environments matched. I think you can set RVM defaults by typing "rvm default" plus the version you want to default to. That way both your Terminal and RubyMine environments match.

    Lastly, be aware that RubyMine allows more than one version of a Gem to be installed at the same time. So, if you're getting an error that a Gem is failing because some dependency requires a specific version, you can tell RubyMine to install multiple versions. Do this thru the SDK manager, select the Gem, then click "Select Versions".

    Hopefully some of this information applies to your issue. I sort of did the shotgun approach, because I'm not really sure what is causing your error, but maybe some of this can put you on the right path. One final note would be this: Use your Gemfile to control Gem versions, if need be. I've spent hours of frustration over broken dependencies, only to discover that the reason for the break was me telling RubyMine to update all my Gems to the latest version. The latest version of a particular Gem isn't necessarily backwards compatible with previous versions, and blindly updating Gems can cause huge problems.