New to JRoR development using IDea
Hello,
Starting from scratch, I was just able to get IntelliJ IDea Ruby plugin v1.5.20660 working with IDea 7.0.4 and the latest JRuby SDK (1.1.5).
After installing JRuby and setting up a JRUBY_HOME and putting its bin in my path, I did the following gem installs: (after trial/error and with a little help)
jruby -S gem install rails -y --no-rdoc --no-ri
jruby -S gem install activerecord-jdbc-adapter --no-rdoc --no-ri
jruby -S gem install activerecord-jdbcmysql-adapter --no-rdoc --no-ri
jruby -S gem install activerecord-jdbc-adapter --no-rdoc --no-ri
jruby -S gem install rake
jruby -S gem install jruby-openssl --no-rdoc --no-ri
jruby -S gem install jdbc-sqlite3 --no-rdoc --no-ri
jruby -S gem install activerecord-jdbcsqlite3-adapter --no-rdoc --no-ri
(I did got the mysql gem because I was planning to use that, and might use oracle also in a test project.)
Then I installed the plugin (unzipped it and put the jruby directory in ]]>/plugins/ and setup a new JRoR project in IDea via:
File -> New Project
Choose Create project from scratch
Click next
Give it a project name
Click on Ruby Module
Click next
For Specify the Ruby SDK click "Configure" button to right
Click on yellow plus sign "+" to the left above the list of SDKs (you may only have 1.5 listed)
Choose JRuby SDK
Point it at the jruby dir
Click Ok
Be sure the JRuby SDK is selected
Click Next
Check Rails
Click Next
Click Finish
Then I edited the project's db/database.yml and changed "sqlite3" to "jdbcsqlite3" for each adapter, so that it looks like:
SQLite version 3.x
gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: jdbcsqlite3
database: db/development.sqlite3
timeout: 5000
Warning: The database defined as "test" will be erased and
re-generated from your development database when you run "rake".
Do not set this db to the same as development or production.
test:
adapter: jdbcsqlite3
database: db/test.sqlite3
timeout: 5000
production:
adapter: jdbcsqlite3
database: db/production.sqlite3
timeout: 5000
I went to "Run" and was able to see the Welcome Aboard, etc. at http://localhost:3000/ and was even able see the versions after clicking on About your application's environment page (which was the reason I wanted to get sqlite3 to work.
I also see:
Getting started
Here’s how to get rolling:
1. Use script/generate to create your models and controllers. To see all available options, run it without parameters.
2. Set up a default route and remove or rename this file. Routes are set up in config/routes.rb.
3. Create your database. Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.
I found the v1.5 docs at http://www.jetbrains.net/confluence/display/RUBYDEV/RubyPlugin1.5ReleaseNotes which was very helpful, but I'm just wondering whether I'm missing anything else about what it can do. It looks like it has a bunch of features that will be helpful (autocompletion and the like). I might upgrade to IDea v8 and v2 of the plugin, but I'm still trying to decide.
All that said...
Is there a way to generate a new scaffold without going to command-line? Is that and gem installations the two main things that I would still need to do at command-line, and the rest can pretty much be done via the IDE (since it can run the app)?
Thanks in advance for any info you can provide,
Gary
Note also that the wiki documentation link on the plugin page at http://plugins.intellij.net/plugin/?id=1293 is currently a bit broken although it does contain a link to the renamed page:
http://www.jetbrains.net/confluence/display/RUBYDEV/IntelliJIDEARuby+Plugin
请先登录再写评论。
Actually I guess there are a lot of commands that might still need to be run at command-line?
The main question I have is whether there are tools I've overlooked in the plugin to do these things.
Hi Gary,
Thank you for your feedback!
About what scaffold do you talk about? Ruby plugin allows to generate skeleton of new rails application also you can run available rails generators(e.g. controller, scaffold, model, migration, etc.) from Project View/Rails Project View tree (Context menu -> New ->)
Gem installer isn't available in Ruby Plugin 2.0 but it is in our nearest plans for autumn/winter.