Project
Ruby
Priority
Major
Type
Bug
Fix versions
RubyMine 1.1.1
State
Won't fix
Assignee
Unassigned
Subsystem
RubyGems
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Jörg B.
    2 years ago (06 Jun 2009 07:04)
  • Updated by   Vadim Gurov
    8 months ago (18 May 2011 18:22)
  • Jira: RUBY-4265
    (history, comments)
 
RUBY-4265 RubyMine does not use proper gem command for Ruby Interpreter?
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
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?


  • J

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
Comments (3)
 
History
 
Linked Issues (?)
 
Roman Chernyatchik
  Roman Chernyatchik
06 Jun 2009 23:05
2 years ago
As far as I know it's bug in rails templates. And our guy Dennis Ushakov reported a bug to rails.

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.
Dennis Ushakov
  Dennis Ushakov
06 Jun 2009 23:49
2 years ago
Exact bug is https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2531
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.
Dennis Ushakov
  Dennis Ushakov
17 Jun 2009 14:43
2 years ago
As it was said above, this is a Rails bug, there's nothing we can do except submitting the patch to the Rails community. Please use instructions in the post http://www.jetbrains.net/devnet/message/5239767#5239767 to set up environment in order to make ruby work correctly.