My Solana "quick, wildman, hate-to-read-the-docs" test worked out better much better than Eth.
Here is what I did:
# install the solana cli
macos$ sh -c "$(curl -sSfL https://release.solana.com/v1.10.23/install)"
# generate and save a public key
solana-keygen pubkey
export SOLANA_DEVAPI_PUBLIC_KEY= 'use key generated above'. #add to `.profile` if you want
# connect to the devnet cluster
solana config set --url https://api.devnet.solana.com
# install rails a new rails project just in-case this turns into a "real project"....
rails new solana
cd solana
vi Gemfile
gem 'solana_rpc_ruby'
bundle
rails g solana_rpc_ruby:install
Amazingly, all worked OK, so I wrote this quick test module:
require 'solana_rpc_ruby'
module NeoSol
class Tests
def self.hello_world
account_pubkey = ENV['SOLANA_DEVAPI_PUBLIC_KEY']
method_wrapper = SolanaRpcRuby::MethodsWrapper.new(
cluster: 'https://api.devnet.solana.com',
# from range 1 to 99_999 will be used
id: rand(1..99999)
)
puts method_wrapper.cluster
puts method_wrapper.id
puts "Balance #{method_wrapper.get_balance(account_pubkey)}"
pp method_wrapper.get_balance(account_pubkey)
pp method_wrapper.api_client
response = method_wrapper.get_account_info(account_pubkey)
pp response
end
end
end
In the rails console:
irb(main):029:0> require "./lib/assets/test1.rb"
=> true
irb(main):030:0> NeoSol::Tests.hello_world
https://api.devnet.solana.com
37401
Balance #<SolanaRpcRuby::Response:0x000000010a4f8930>
#<SolanaRpcRuby::Response:0x000000010a5432f0
@parsed_response=
{"jsonrpc"=>"2.0",
"result"=>
{"context"=>{"apiVersion"=>"1.10.23", "slot"=>138753442},
"value"=>499995000},
"id"=>37401},
@response=#<Net::HTTPOK 200 OK readbody=true>>
#<SolanaRpcRuby::ApiClient:0x000000010a5124e8
@cluster="https://api.devnet.solana.com">
#<SolanaRpcRuby::Response:0x000000010a528040
@parsed_response=
{"jsonrpc"=>"2.0",
"result"=>
{"context"=>{"apiVersion"=>"1.10.23", "slot"=>138753442},
"value"=>
{"data"=>"",
"executable"=>false,
"lamports"=>499995000,
"owner"=>"11111111111111111111111111111111",
"rentEpoch"=>320}},
"id"=>37401},
@response=#<Net::HTTPOK 200 OK readbody=true>>
=>
#<SolanaRpcRuby::Response:0x000000010a528040
@parsed_response=
{"jsonrpc"=>"2.0",
"result"=>
{"context"=>{"apiVersion"=>"1.10.23", "slot"=>138753442},
"value"=>{"data"=>"", "executable"=>false, "lamports"=>499995000, "owner"=>"11111111111111111111111111111111", "rentEpoch"=>320}},
"id"=>37401},
@response=#<Net::HTTPOK 200 OK readbody=true>>
irb(main):031:0>
Amazing. The Solana dev environment using the solana-rpc-ruby Ruby Gem is already up and running, where I was fighting errors and scratching my head with Ethereum.
My morning coffee is not cold and my head is just now "unfuzzing" from sleep, and I have a Solana dev environment up and running in a Rails project. Thanks for this nice gem ![]()
Looks like I am going to drop / table Ethereum dev testing and continue on with Solana.
Reference:

