我尝试过的每个项目都会发生这种情况:
如果我使用终端并说 bundle install 或 rake db:migrate ,它工作正常,可以看到我的网站,工作完全正常。
但是如果我在 RubyMine 中打开项目并想要执行相同的任务,它会给我各种各样的错误。我只是复制粘贴其中一些作为示例。
我确信应该在某处设置一些小项目设置。但不知道是什么和在哪里
注意:在 Rails 1.8 上总是设置一个“编辑配置”,尽管我将其更改为 Rails 1.9 ,但仍然没有区别。
我在 Mac 上运行最新版本的 RubyMine。
/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
编辑:运行 bundler 安装后,从 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.
最佳答案
我在使用 RubyMine 时遇到了同样的错误。我通过添加以下内容解决了“没有 tty....”错误:
Defaults visiblepw
至
/etc/sudoers
文件。
关于rubymine - 调整 RubyMine IDE,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14431111/