问题
This happens for every single project that I have tried: If I use terminal and say bundle install or rake db:migrate , it works fine, can see my website , works completely fine.
But If I open project in RubyMine and want to do the same tasks it gives me all sorts or errors. I just copy paster some of them as an example.
I am sure there is some small project setting that should be set somewhere. But don't know what and where
Note: There is a "edit configuration" that is always set on Rails 1.8 and although I change it to Rails 1.9 , still makes no difference.
I am running the latest version of RubyMine on Mac.
/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /usr/bin/rake db:migrate
/Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/spec_set.rb:90:in `materialize': Could not find i18n-0.6.1 in any of the sources (Bundler::GemNotFound)
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `map!'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/spec_set.rb:83:in `materialize'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/definition.rb:113:in `specs'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/definition.rb:158:in `specs_for'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/definition.rb:147:in `requested_specs'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/environment.rb:23:in `requested_specs'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:11:in `setup'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler.rb:116:in `setup'
from /Users/JonyIve/.gem/ruby/1.8/gems/bundler-1.2.3/lib/bundler/setup.rb:17
EDIT: After running bundler install, from IDE :
/usr/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/JonyIve/.gem/ruby/1.8/bin/bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
sudo: no tty present and no askpass program specified
Gem::Exception: Cannot load gem at [/Library/Ruby/Gems/1.8/cache/rake-10.0.3.gem] in /Users/JonyIve/Downloads/code-1/rails32/depot_c
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.3'` succeeds before bundling.
回答1:
I was getting the same error while using RubyMine. I have solved the "no tty present...." error by adding:
Defaults visiblepw
to
/etc/sudoers
file.
回答2:
I asked from the author, here is his answer:
http://devnet.jetbrains.net/message/5476810#5476810
回答3:
Have you tried Tools->Run Bundler from the IDE menu? You need to run the Bundler from within Rubymine in addition to the console to update the IDE's copy of the gems.
回答4:
okay, i had this same issue. it was caused because the ruby that rubymine sdk was pointing to was the system ruby, /usr/bin/ruby--- aliased to the one in Library instead of the one in ln -svf /usr/local/Cellar/ruby/2.0.0-p247/bin/ruby
replacing the link with the one pointing to the local version solved the issue.
来源:https://stackoverflow.com/questions/14431111/tuning-rubymine-ide