I am using RubyMine 1.1 and wanted to create a new rails project. I have one Ruby interpreter set up (the 1.8.7 one from macports installed in /opt/local ... (see attached screenshot)) & I specified a new template to use for the project (
http://gist.github.com/115163.txt).
Now the strange is that for some reason rubymine seems to use the proper ruby interpreter, but the gem command seems to be an outdated one (the default one from leopard maybe??):
/opt/local/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /opt/local/bin/rails _2.3.2_ /Users/joerg/Development/dwbe –template /Volumes/Leopard-Data/Downloads/rails-project-template.rb –skip –database=mysql
exists
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
applying template: /Volumes/Leopard-Data/Downloads/rails-project-template.rb
executing rm public/index.html from /Users/joerg/Development/dwbe
plugin restful_authentication
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
plugin thinking_sphinx
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
plugin will_paginate
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
plugin factory_girl
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
plugin paperclip
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
plugin project_search
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
plugin hubahuba
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
generating rspec
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
generating cucumber
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
generating authenticated
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update –system` and try again.
Freeze rails gems ?
...
However, checking which 'gem' version I have reveals I have 1.3.4 setup:
which rails
/opt/local/bin/rails
macPro:~ joerg$ which gem
/opt/local/bin/gem
macPro:~ joerg$ gem –version
1.3.4
macPro:~ joerg$ which ruby
/opt/local/bin/ruby
macPro:~ joerg$ ruby –version
ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-darwin9]
macPro:~ joerg$ rails –version
Rails 2.3.2
What's going wrong here?
Environment: Mac OS X 10.5, ruby 1.8.7 installed via macports, gem updated there aswell, rails installed as normal gem etc etc
Issue was closed
About bug:
MacOS use different environment settings for Terminal.app and all other applications. E.g. if you extend PATH variable in ~/.profile only Terminal.app will see this changes. Apple suggest to setup ~/.MacOS/environment.plist, see http://developer.apple.com/qa/qa2001/qa1067.html. Thus 'ruby' command in Terminal.app environment will run interpreter from /op/local/bin/ruby and in RubyMine environment will run /usr/bin/ruby.
Instead of invoking command 'ruby' template should use rake API, see FileUtils in rake.rb. Or at least invoke ruby executable of current interpreter:
# see rake.rb, FileUtils module RUBY_EXT = ((Config::CONFIG['ruby_install_name'] =~ /\.(com|cmd|exe|bat|rb|sh)$/) ? "" : Config::CONFIG['EXEEXT']) RUBY = File.join( Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'] + RUBY_EXT). sub(/.*\s.*/m, '"\&"')Thus I suggest to fix the problem using environment.plist or launch RubyMine from console.
Don't look at windows in it's title, this bug is reproducible on any platform. Second patch (my patch) solves the problem from Rails side, but we'll try to add some workaround from RubyMine side.