简体   繁体   中英

Installing RubyPress

I want to use RubyPress in my project. I've been reading the documentation , and it says that I need to:

  1. Install the gem using gem install rubypress .
  2. Add "rubypress" to my gem file.
  3. In a script require 'rubypress' .

I am not sure where to add require 'rubypress' , also I do not know if by doing the installation it should make a class or if I have to create one class and then continue with the process.

I need it so that a user can make or edit the posts on WordPress and then the posts can be viewed on my website.

I hope that someone can help me with that.

If you are on a Rails project:

  1. Add gem 'rubypress' to your Gemfile.
  2. Run bundle install .
  3. It should be auto-required and no require should be needed. Use it.

The require statement is intended for external usage only (non-Rails).

Ruby on Rails' goal is to be as simple as possible coming out of the box. I have no indication of how far along into the process you are, so I'll start from the beginning.

To be a little more explicit on zachfeldman's instructions:

Checking Your Install:

Installing rubypress

In a terminal/command line shell, type gem install rubypress . This will either work, or it will fail. If you get something like gem: Command not found. it means you don't have gem, or maybe even ruby installed. You will need to go to https://rubygems.org/pages/download and go from there.

If you get back ERROR: could not find gem rubypress locally or in a repository check your spelling, then your internet settings.

Otherwise, rubypress should install nicely.

Adding rubypress to your bundler

In your [path to your app]/gemfile add the line: gem 'rubypress' . This should allow you to now access the gem from anywhere inside of your ruby application. If this doesn't exist, you'll need to build a ruby app.

Inside a Script

Anywhere you want to use rubypress , likely a lot of places, you simply add require 'rubypress' to the top of the file, and that should help you get the rubypress functions you need.

Feel free to comment on where you get stuck, I'll help you walk through. The more details, the better.

~POS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM