Guest User

Untitled

a guest
Apr 26th, 2018
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1.  
  2. DataMapper
  3. Groups Alerts Groups Alerts
  4. Create a group...
  5. Google Groups Home Recently Visited Groups | Help | Sign in
  6.  
  7. DataMapper
  8.  
  9.  
  10. Home
  11. Discussions
  12. Pages
  13. Files
  14. About this group
  15. Join this group
  16.  
  17. Recent pages and files
  18. do_sqlite3-0.9.0-x86-mswin32-60.gem Apr 28
  19. do_postgres-0.9.0-x86-mswin32-60.gem Apr 28
  20. do_mysql-0.9.0-x86-mswin32-60.gem Apr 28
  21. Installing DM edge + Merb Apr 24
  22. do_mysql-0.2.2.gem Dec 23
  23. data_mapper_1.sql May 27
  24.  
  25. Installing DM edge + Merb
  26.  
  27. Git the code you need
  28.  
  29. You'll need to either clone the following projects, or download tarballs from github and unpack them. The former is probably a better choice, so that you can pull down updates as work continues on the project.
  30.  
  31. * do: git://github.com/sam/do.git
  32. * dm-core: git://github.com/sam/dm-core.git
  33. * dm-more: git://github.com/sam/dm-more.git
  34.  
  35. I'll assume that you're putting all of this stuff into a single common directory, like this:
  36.  
  37.  
  38.  
  39. mkdir build
  40.  
  41. cd build
  42.  
  43. git-clone git://github.com/sam/do.git
  44.  
  45. ...
  46. Install Merb
  47.  
  48. The current Merb gems available from Rubyforge are stable, and (now that some plugin issues have been settled) should work fine with the bleeding edge DataMapper.
  49.  
  50.  
  51.  
  52. sudo gem install merb-core
  53.  
  54. sudo gem install merb-more
  55.  
  56.  
  57. But, if you want to install edge Merb, too, then you'll need to clone these repositories:
  58.  
  59. * merb-core: git://github.com/wycats/merb-core.git
  60. * merb-more: git://github.com/wycats/merb-more.git
  61.  
  62. And build and install the gems from source:
  63.  
  64.  
  65.  
  66. cd merb-core
  67.  
  68. sudo rake gem install
  69.  
  70. cd ../merb-more
  71.  
  72. sudo rake gem install
  73.  
  74. If you want to build the additional Merb stuff from source, that's fine (so you have the bleeding edge), but installing that stuff from Rubyforge gems should work.
  75. Build DataObjects
  76.  
  77. You'll need to build the data_objects gem, and at least one of the database-specific plugins. Don't use do_jdbc yet, as it's still very much a work in progress (so, still no JRuby; sorry). In my case, I picked do_mysql.
  78.  
  79.  
  80.  
  81. cd do/data_objects
  82.  
  83. sudo rake gem install
  84.  
  85. cd ../do_mysql
  86.  
  87. sudo rake gem install
  88.  
  89.  
  90.  
  91. (You should probably make sure that the mysql_config command is in your PATH before trying to build the do_mysql gem.)
  92. Build DataMapper
  93.  
  94. More of the same. You shouldn't need to do anything special here.
  95.  
  96.  
  97.  
  98. cd dm-core
  99.  
  100. sudo rake gem install
  101.  
  102. cd ../dm-more
  103.  
  104. sudo rake gem install
  105. Create Your Application
  106.  
  107. Now it's time to create the Merb application. If you've done this before with the earlier DataMapper, it still works much like you'd expect:
  108.  
  109.  
  110. merb-gen app sample
  111.  
  112. cd sample
  113.  
  114.  
  115. Now open up config/init.rb in the application you just generated. Find where the commented-out calls to use_orm are, un-comment the line that says:
  116.  
  117.  
  118. use_orm :datamapper
  119.  
  120. Now you're ready to generate your first resource code. This'll take two steps: the first time you try, merb-gen will create a sample database configuration file and halt. After you've edited that with the details of your database, running the command again will succeed.
  121.  
  122.  
  123. merb-gen resource widget
  124.  
  125. mv config/database.yml.sample config/database.yml
  126.  
  127. nano config/database.yml
  128.  
  129. merb-gen resource widget
  130.  
  131. Version:
  132. 3 messages about this page
  133. May 16 2008 by Max
  134. Maybe update this page to include sake instructions?
  135. May 4 2008 by Michael Klishin
  136. 2008/5/4 dkubb <dan.kubb@gmail.com>:
  137. People at #merb keep asking about Merb plugin and there's nowhere to
  138. refer them to ;)
  139. May 3 2008 by dkubb
  140. Shouldn't this also provide instructions on installing dm-more/
  141. merb_datamapper?
  142. Report this page
  143. Sign in to discuss
  144.  
  145. Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
  146. ©2008 Google
Add Comment
Please, Sign In to add comment