I'm have problem with the gem

47 views
Skip to first unread message

Nicholas

unread,
Mar 13, 2011, 7:13:21 PM3/13/11
to bb-ruby
Hello,

I am trying to use the gem bb-ruby but output me an error
no such file to load -- bb-ruby


app/controllers/posts_controller.rb:3:in `<class:PostsController>'
app/controllers/posts_controller.rb:1:in `<top (required)>'
This error occurred while loading the following files:
bb-ruby


thanks for help.
Nikolai Ilushko

Craig P Jolicoeur

unread,
Mar 13, 2011, 8:01:09 PM3/13/11
to bb-...@googlegroups.com
Hi Nikolai

Can you give me a bit more info about your app setup? Is it a rails app? Rails 2 or 3? Can you paste your Gemfile and Posts controller file so I can see how you are loading the gem in code?

- Craig

> --
> You received this message because you are subscribed to the Google Groups "bb-ruby" group.
> To post to this group, send email to bb-...@googlegroups.com.
> To unsubscribe from this group, send email to bb-ruby+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/bb-ruby?hl=en.
>

Nicholas

unread,
Mar 14, 2011, 3:27:50 PM3/14/11
to bb-ruby

posts_controller.rb

class PostsController < ApplicationController
# GET /posts
# GET /posts.xml
def index
@posts = Post.all

respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
end

# GET /posts/1
# GET /posts/1.xml
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
end
end

# GET /posts/new
# GET /posts/new.xml
def new
@post = Post.new

respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
end
end

# GET /posts/1/edit
def edit
@post = Post.find(params[:id])
end

# POST /posts
# POST /posts.xml
def create
@post = Post.new(params[:post])

respond_to do |format|
if @post.save
format.html { redirect_to(@post, :notice => 'Post was
successfully created.') }
format.xml { render :xml => @post, :status
=> :created, :location => @post }
else
format.html { render :action => "new" }
format.xml { render :xml => @post.errors, :status
=> :unprocessable_entity }
end
end
end

# PUT /posts/1
# PUT /posts/1.xml
def update
@post = Post.find(params[:id])

respond_to do |format|
if @post.update_attributes(params[:post])
format.html { redirect_to(@post, :notice => 'Post was
successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @post.errors, :status
=> :unprocessable_entity }
end
end
end

# DELETE /posts/1
# DELETE /posts/1.xml
def destroy
@post = Post.find(params[:id])
@post.destroy

respond_to do |format|
format.html { redirect_to(posts_url) }
format.xml { head :ok }
end
end
end


gemfile

source 'http://rubygems.org'

gem 'rails', '3.0.5'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'bb-ruby'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby
1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end

also I have new error :(

uninitialized constant ActionView::CompiledTemplates::BBRuby

12:
13: <p>
14: <b>Content:</b>
15: <%= BBRuby.to_html(@post.content) %>
16: </p>
17:
18:

Craig P Jolicoeur

unread,
Mar 15, 2011, 9:02:06 AM3/15/11
to bb-...@googlegroups.com
try explicitly requireing the lib files

require 'bb-ruby'

- Craig

ניקולס ילושקו

unread,
Mar 15, 2011, 2:31:13 PM3/15/11
to bb-...@googlegroups.com, Craig P Jolicoeur
The error is gone but It's output me 

Name: Nikolai Ilushko

Title: Hello Word

Content: Hi welcome to my rails <strong>app</strong>

Edit | Back

but not html 
when I've wrote in   Content
Hi welcome to my rails [b]app[/b]
Reply all
Reply to author
Forward
0 new messages